facebook

Ent Application Project structure without EJBs

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #208386 Reply

    Leon Webster
    Member

    We 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.servlet2pkg

    However, 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

    #208390

    Scott Anderson
    Participant

    Leon,

    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.

    #208487

    Leon Webster
    Member

    Scott,

    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

    #208504

    Scott Anderson
    Participant

    During 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.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Ent Application Project structure without EJBs

You must be logged in to post in the forum log in