Problem accessing resources in other depending projects [message #897302] |
Mon, 23 July 2012 10:23  |
Eclipse User |
|
|
|
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 11:26   |
Eclipse User |
|
|
|
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 #898590 is a reply to message #898409] |
Thu, 26 July 2012 13:52  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.27884 seconds