• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem with Beans being unpacked

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,
Would really, really appreciate any help on the following matter. It may appear a little confusing so please bear with me .....
I have recently completed a build script which
essentially creates a .ear file on my C: drive. The .ear file was made up of a .war file and numerous EJB jar files. When I restart ocj4, the .ear and .war seem to unpack fine except when it goes to deploying the Beans, I get the following error:

Error in application imapInternet: Error loading package at file:/C:/iMAPInterne
t/AADatabaseEJB.jar, Class 'imap.app.ejb.session.aadatabase.AADatabaseBean' not
found
The EJB jars themselves are found in C:\iMAPInternet. The application.xml for the .ear lists the different EJB jar files and that seems to be ok because at least its looking for the correct EJB jars which it tries to deploy.
The ejb.xml file that is in each of the individual EJB jar files points to the following directory for the classes - imap.app.ejb.session.FOLDER_NAME -
The code for the Beans, (+ their Home and Remote interfaces) are located in the following directory:
C:iMAPInternet/iMapWeb/WEB-INF/classes/imap.app.ejb.session
so for the AADatabaseBean , the class would be located in C:iMAPInternet/iMapWeb/WEB-INF/classes/imap.app.ejb.session/aadatabase.
However, from the error message above, it can't seem to see it there.
Please, Please help with this if you can.
Thanks
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

imap.app.ejb.session.FOLDER_NAME -
The code for the Beans, (+ their Home and Remote interfaces) are located in the following directory:
C:iMAPInternet/iMapWeb/WEB-INF/classes/imap.app.ejb.session
so for the AADatabaseBean , the class would be located in C:iMAPInternet/iMapWeb/WEB-INF/classes/imap.app.ejb.session/aadatabase.


I could be way off here, but why do you have a directory with "." in the name. The reason why this confuses me, and probably what confuses the App Server, is that in Java a package name has the periods in them, which means a separate directory for each name between the periods.
I would have expected to see a directory structure like
C:iMAPInternet/iMapWeb/WEB-INF/classes/imap/app/ejb/session/aadatabase
Hope this is why, but I could be completely wrong.
Mark
 
L Brennan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,
Thanks for your reply, but I don't think that was the issue. We have used this before and it has worked fine. We came up with the following work around which may prove useful for anyone with the same problem:
Essentially, my .ear file was made up of a .war file, (which contained all of the class packages, jsps etc), and several EJB jar files. We were having Class Loader problems. The .ear had been unpacked and the EJBs were deployed. The individual ejb-jar.xmls were pointing to packages contained in the classes directory that was found in the .war. Apparently, when it comes to Class Loading the application couldn't see the contents of war file. For exampl, when the web component loads classes it can access anything that is contained in the application classpath. If its not there, it will try to load it itself. The reverse is not true, however. The application can't see the .war stuff. The ejb-jar.xml files were pointing to a location that couldn't be seen by the application, (this is in a Class Loading context).
I know this explanation is quite bad, but its the best I can do at the moment. The solution was to modify my ant build.xml to jar up the classes folder and place in the same directory as my other jar files. (I then deleted the WEB-INF/classes dir so as not to have the same code in two different places). The jars and the war were then packaged up into a .ear file. The application.xml file, (in C:\oc4j\j2ee\home), pointed to this directory as a classpath so the application could then see it.
The Beans are deploying fine and the applications is working dandy!!
[ April 30, 2003: Message edited by: L Brennan ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic