For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 3 replies, 2 voices, and was last updated 21 years, 4 months ago by
Scott Anderson.
-
AuthorPosts
-
Leon WebsterMemberWe are using MyEclipse 3.8, along with Eclipse 3.0 RC1. The server is WebLogic 8.1.
We have an enterprise app that contains two web apps. Each of the web apps reference some utility classes. We would like these utility classes to be loaded by the application classloader ( as opposed to having each webapp’s class loader loader them). so the deployed (exploded) structure would look something like this:
MyEnterpriseApp
|
|-com.xxxx.utilpkg
|
|-MyWebApp1
| |
| |–com.xxxx.servlet1pkg
|
|-MyWebApp2
|
|–com.xxxx.servlet2pkgHowever, I found out that I can’t put any source under “MyEnterpriseApp”. I had to create an ejb project under the enterprise application, and move the com.xxxx.utilpkg files under the ejb application. Then, in order to get it to deploy correctly I had to add an ejb and generate an ejb-jar.xml descriptor.
I would prefer not to have to create the separate project or the fake ejb. Is there a way to accomplish this?
Thanks much.
Leon Webster
June 11, 2004 at 3:34 pm #208390
Scott AndersonParticipantLeon,
Yes, there’s a better way to do what you want. Simply place the jar at the top level of the EAR project and add Class-Path entries in the MANIFEST.MF files for each of the webapps to point to the libraries location in the EAR. That will get your library deployed correctly and make it referencable at run time in the app server.
However, you’ll also need to add the jar to each web project’s classpath manually (Add Jar…) so that the classes can be resolved at compilation time in the workbench. That should do it.
June 14, 2004 at 1:05 pm #208487
Leon WebsterMemberScott,
couple of questions:
During development I don’t have a jar — instead, I would like to put a “src” directory under the EAR project. but when I attempt to do that, I get a message informing me that the ear project is not a java project. The exact message is: “Project is not a Java project” I presume I would have the same problem if I attempted to add a jar to the ear project.
Secondly, assuming I could add files to the ear, the class path entries in MANIFEST>MF would berelative directories, right?
Thanks
Leon
June 14, 2004 at 5:35 pm #208504
Scott AndersonParticipantDuring development I don’t have a jar — instead, I would like to put a “src” directory under the EAR project.
This isn’t permitted because the EAR projects are not created as java projects since according to the spec an EAR is just a packaging structure, without source content of its own.
I presume I would have the same problem if I attempted to add a jar to the ear project.
No, you won’t. Simply go to the Navigator view and import whatever Jar you need or copy and paste one from another project.
Secondly, assuming I could add files to the ear, the class path entries in MANIFEST>MF would berelative directories, right?
Yes, the jars you add to the ear can be referenced relative to their place in the EAR as the J2EE packaging spec details.
-
AuthorPosts
