Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Problem accessing resources in other depending projects
Problem accessing resources in other depending projects [message #897302] Mon, 23 July 2012 14:23 Go to next message
Franco Giustetto is currently offline Franco Giustetto
Messages: 6
Registered: July 2012
Junior Member
Hello, I'm faced with an access problem of resources located in a project different from the main project.
I working on Eclipse Helios.
I have a project called Absweb that is (as the name suggest) a JAX-WS Web project build over ZK framework.
This project use controller beans taken from another project (ABSBL where BL stay for Business logic) where I can found the cache initialization file "cache.ccf"
again the ABSBL project use POJO from the ABSDB project (where DB stay for DataBase) where I can found the SqlConfig.XML files which contains definition for MyBatis framework.
ABSBL and ABSDB are both Java Projects.

When i build the various projects I get, among others, these warnings....

Classpath entry /ABSBL will not be exported or published. Runtime ClassNotFoundExceptions may result.
Classpath entry /ABSBL/bin/cache.ccf will not be exported or published. Runtime ClassNotFoundExceptions may result.
Classpath entry /ABSDB will not be exported or published. Runtime ClassNotFoundExceptions may result.
Classpath entry /ABSDB/src/SqlMapConfig.xml will not be exported or published. Runtime ClassNotFoundExceptions may result.

all throne by Classpath Dependency Validator Message

This is strange because I try both check and uncheck the "export" flag in the "Order and export" properties page without any substantial changes.

These are warnings, so I could also ignore it, but...
As soon I start the web application and the Spring container try to instantiate one of the ABSBL that contain the following line:

cache = JCS.getInstance("runValueCache");

I get an exception that tell me that the cache.ccf file cannot be found.
here a sample stack trace ( please tell me if you need complete stack trace or any other config file)
java.lang.IllegalStateException: Failed to load properties for name [/cache.ccf]
at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:242)
at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:194)
at org.apache.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:122)
at org.apache.jcs.JCS.ensureCacheManager(JCS.java:96)
at org.apache.jcs.JCS.getInstance(JCS.java:64)
...more

and if I avoid to instatiate this class by removing it from Spring's Application context I get errors as soon I instatiate a class that require the SqlMapConfig.xml exported by the ABSDB Jar file...
That is: it seems that I cannot see any resource exported from my projects or better, it seems I cannot export any resouces from my projects.
This problem drive me crazy because I think I try every possible declaration combination without any appreciable result.
could anybody help me?
Tahnk you
Franco
Re: Problem accessing resources in other depending projects [message #897328 is a reply to message #897302] Mon, 23 July 2012 15:26 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
If you right-click on the warning and use "Quick Fix", it will update
the configuration of the projects so ABSBL will be built into ABSBL.jar
and included in the published Absweb webapp. This is the best GUI way
to create this dependency.

Cheers,
Larry


On 7/23/2012 10:23 AM, Franco Giustetto wrote:
> Hello, I'm faced with an access problem of resources located in a
> project different from the main project.
> I working on Eclipse Helios.
> I have a project called Absweb that is (as the name suggest) a JAX-WS
> Web project build over ZK framework.
> This project use controller beans taken from another project (ABSBL
> where BL stay for Business logic) where I can found the cache
> initialization file "cache.ccf"
> again the ABSBL project use POJO from the ABSDB project (where DB stay
> for DataBase) where I can found the SqlConfig.XML files which contains
> definition for MyBatis framework.
> ABSBL and ABSDB are both Java Projects.
>
> When i build the various projects I get, among others, these warnings....
>
> Classpath entry /ABSBL will not be exported or published. Runtime
> ClassNotFoundExceptions may result. Classpath entry /ABSBL/bin/cache.ccf
> will not be exported or published. Runtime ClassNotFoundExceptions may
> result. Classpath entry /ABSDB will not be exported or published.
> Runtime ClassNotFoundExceptions may result.
> Classpath entry /ABSDB/src/SqlMapConfig.xml will not be exported or
> published. Runtime ClassNotFoundExceptions may result.
> all throne by Classpath Dependency Validator Message
>
> This is strange because I try both check and uncheck the "export" flag
> in the "Order and export" properties page without any substantial changes.
>
> These are warnings, so I could also ignore it, but...
> As soon I start the web application and the Spring container try to
> instantiate one of the ABSBL that contain the following line:
>
> cache = JCS.getInstance("runValueCache");
>
> I get an exception that tell me that the cache.ccf file cannot be found.
> here a sample stack trace ( please tell me if you need complete stack
> trace or any other config file)
> java.lang.IllegalStateException: Failed to load properties for name
> [/cache.ccf]
> at
> org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:242)
>
> at
> org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:194)
>
> at
> org.apache.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:122)
>
> at org.apache.jcs.JCS.ensureCacheManager(JCS.java:96)
> at org.apache.jcs.JCS.getInstance(JCS.java:64)
> ..more
>
> and if I avoid to instatiate this class by removing it from Spring's
> Application context I get errors as soon I instatiate a class that
> require the SqlMapConfig.xml exported by the ABSDB Jar file...
> That is: it seems that I cannot see any resource exported from my
> projects or better, it seems I cannot export any resouces from my projects.
> This problem drive me crazy because I think I try every possible
> declaration combination without any appreciable result.
> could anybody help me?
> Tahnk you
> Franco
Re: Problem accessing resources in other depending projects [message #897347 is a reply to message #897328] Mon, 23 July 2012 16:45 Go to previous messageGo to next message
Franco Giustetto is currently offline Franco Giustetto
Messages: 6
Registered: July 2012
Junior Member
Thank you Larry,
it seems not so easy to solve Sad : despite I used the quick fix as you told me, after selecting the quick fix "Mark the associated raw classpath entry as a publish/export dependency", the warning desappear, but the exception is still there. Evil or Very Mad
Tell me if I'm wrong: After defining that the Cache.ccf file is exported from the ABSBL project have I to explicity import it in ABSWeb project or not?

Maybe I'm wrong, but there is another thing that sound strange to me:
In the Java Build path of ABSWeb project I have had to explicity define as external Jar a lot of library like myBatis*.jar, spring*.jar, struts*.jar. zk*.jar..despite it has been defines as Class Folder the WebContent/WEB_INF/lib jar and in that Folder all the required library has been already copied.

I notice that if I didn't specify them in Java Build path the whole ABSWeb project become like a Xmast Tree for All the dependencies not resolved.
If I didnt' copy them in the WEB_INF/lib folder they cannot recognized at run time givin runtime exception for class not found errors...How many time I have to specify to use a library?
Or mybe that the project has been messed up by copying Jar in WEB_INF/lib folder ?
Or I have miss to do something that I don't understand?

any suggestion is obviously welcome
thank you

Franco
Re: Problem accessing resources in other depending projects [message #897558 is a reply to message #897347] Tue, 24 July 2012 13:47 Go to previous messageGo to next message
Franco Giustetto is currently offline Franco Giustetto
Messages: 6
Registered: July 2012
Junior Member
I try to fix every warning regarding either
Classpath entry xxxx will not be exported or published
or
Classpath entry xxxx is marked for publish/export ...

Now my ABSWeb Project exports all the dependency Jar that was in the web_inf\lib
but now my program crash earlier this is the stack trace:

24-lug-2012 15:13:22 org.apache.catalina.core.StandardContext listenerStart
GRAVE: Error configuring application listener of class org.zkoss.zk.ui.http.HttpSessionListener
java.lang.ClassNotFoundException: org.zkoss.zk.ui.http.HttpSessionListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3915)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
24-lug-2012 15:13:22 org.apache.catalina.core.StandardContext listenerStart
GRAVE: Skipped installing application listeners due to previous error(s)
24-lug-2012 15:13:22 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
24-lug-2012 15:13:22 org.apache.catalina.core.StandardContext start
GRAVE: Context [/ABSWeb] startup failed due to previous errors

the org.zkoss.zk.ui.http.HttpSessionListener is loaded in the WEb.xml file:

<!--  listener for ZK -->
<listener>
	<description>Used to cleanup when a session is destroyed</description>
	<display-name>ZK Session cleaner</display-name>
	<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
</listener>


why it cannot find the org.zkoss.zk.ui.http.HttpSessionListener ?
this class is located in the zk.jar and this file is exported in my ABSWeb application!

Do you have any Idea? Question
Thank you
Franco

icon8.gif  Re: Problem accessing resources in other depending projects [message #898409 is a reply to message #897558] Thu, 26 July 2012 10:47 Go to previous messageGo to next message
Franco Giustetto is currently offline Franco Giustetto
Messages: 6
Registered: July 2012
Junior Member
Hello,
I cleaned up and revised the wole dependency structure of the project by defining a User library that contains all referenced library and I included that library in my web project.
I exported everything ( by appling the quick fix in the warning problem marker 'Classpath entry xxxx will not be exported or published') and I rebuilt the web project.
I actually have no more needs to manually copy jar file in the WEB-INF directory and now the WEB-INF directory is empty.

But when I run the application on Apache 6.0 web server I still get this error:
24-lug-2012 15:13:22 org.apache.catalina.core.StandardContext listenerStart
GRAVE: Error configuring application listener of class
java.lang.ClassNotFoundException: org.zkoss.zk.ui.http.HttpSessionListener
Crying or Very Sad

This Class org.zkoss.zk.ui.http.HttpSessionListener is located in the zk.Jar file.
The zk.jar file is in the same directory of all other Zk Jars and it is present in the user library and should be (therefore) exported together with all other Jar files

To check that everything was correct I explored the
.metadata\.plugins\org.eclipse.wst.server.core\tmpwtpwebapps\ABSWeb\WEB-INF\lib
directory

Shocked Belive me or not, I found in that directory ALL the Jar but no zk.jar!!! Shocked

As soon as I manually copied there the zk.jar the application begin to run without the ClassNotFoundException.

How is it possible? why the compiler deploy all the jar except one? Why that one?
thank you to everybody who could answer me!

Franco

Re: Problem accessing resources in other depending projects [message #898590 is a reply to message #898409] Thu, 26 July 2012 17:52 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Hi Franco,

Sorry for not responding quicker. I had been working on a response in
my spare time to your earlier posts and hadn't found enough spare time
to actually complete one. Fortunately, the longer the delay, the
simpler the answer becomes. :)

Congratulations, at this point you appear to have your projects set up
in the preferred manner. Unfortunately you also may be experiencing a
known intermittent publishing problem[1]. It can cause a symptom like
yours which won't fix itself until your force a "full" publish (instead
of the "delta" publish that normally occurs). You force a full publish
by right-clicking on the server in the Servers view and selecting
"Clean...". Hopefully you will see zk.jar appear in the
"wtpwebapps\ABSWeb\WEB-INF\lib" directory. Post back if it doesn't.

Cheers,
Larry

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=365748

On 7/26/2012 6:47 AM, Franco Giustetto wrote:
> Hello, I cleaned up and revised the wole dependency structure of the
> project by defining a User library that contains all referenced library
> and I included that library in my web project.
> I exported everything ( by appling the quick fix in the warning problem
> marker 'Classpath entry xxxx will not be exported or published') and I
> rebuilt the web project.
> I actually have no more needs to manually copy jar file in the WEB-INF
> directory and now the WEB-INF directory is empty.
>
> But when I run the application on Apache 6.0 web server I still get this
> error:
> 24-lug-2012 15:13:22 org.apache.catalina.core.StandardContext listenerStart
> GRAVE: Error configuring application listener of class
> java.lang.ClassNotFoundException: org.zkoss.zk.ui.http.HttpSessionListener
> :cry:
> This Class org.zkoss.zk.ui.http.HttpSessionListener is located in the
> zk.Jar file.
> The zk.jar file is in the same directory of all other Zk Jars and it is
> present in the user library and should be (therefore) exported together
> with all other Jar files
>
> To check that everything was correct I explored the
> metadata\.plugins\org.eclipse.wst.server.core\tmpwtpwebapps\ABSWeb\WEB-INF\lib
>
> directory
> 8o Belive me or not, I found in that directory ALL the Jar but no
> zk.jar!!! 8o
> As soon as I manually copied there the zk.jar the application begin to
> run without the ClassNotFoundException.
>
> How is it possible? why the compiler deploy all the jar except one? Why
> that one?
> thank you to everybody who could answer me!
>
> Franco
>
>
Previous Topic:Updating archives model
Next Topic:J2EE preview
Goto Forum:
  


Current Time: Fri Sep 19 22:02:28 GMT 2014

Powered by FUDForum. Page generated in 0.02200 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software