aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse and ear files on jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse and ear files on jboss" Watch "Eclipse and ear files on jboss" New topic
Author

Eclipse and ear files on jboss

Leonardo Celati
Greenhorn

Joined: Oct 10, 2008
Posts: 3
Hi all,

I have been used this forum a lot, thanks for the ones who previously posted useful information and shared knowledge.

This is my first post. And this is the scenario. Eclipse Ganymede, jboss 4.2.
In Eclipse I have this:
i) project A.jar with a set of useful class.
ii) ejb project B.jar which include A.jar.
iii) ear project C.ear which include A and B.

Whenever I deploy C.ear from eclipse (run on server) to jboss B it's telling me ClassNotFound exception relative to A.jar.

I unpacked the C.ear file in jboss deploy directory and found this structure:

C.ear
--->A.jar
--->B.jar

All at root level, and the manifest doesn't mention anything about A.jar
But...if right click 'C' and export ear file the structure is:

C.ear
lib
+--->A.jar
B.jar

And that ear deployed manually "drag and drop" on jboss run fine with no error.

Am I missing something ? Why this difference in behaviour ?

thanks for all responses...
Leonardo
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

What do you mean by "unpacked"? How did you do that?

Also the C.ear in your two examples, was that the exact same C.ear?

I can see how the second C.ear worked - the JARs in the lib directory are automatically included in the classpath. In the first C.ear, the A.jar would have to be included in the META-INF/application.xml file (you do have one of these, don't you?)

Also, which version of JBossAS?


JBoss In Action
Leonardo Celati
Greenhorn

Joined: Oct 10, 2008
Posts: 3
Thanks for your reply...find the answer below
-------------------------------------------

What do you mean by "unpacked"? How did you do that?

-opened with any archive manager...to see the content

Also the C.ear in your two examples, was that the exact same C.ear?

-One built and deployed by eclipse after pressing "play" or "run on server", the other one built by me with file-->export ear then deployed manually to jboss...

I can see how the second C.ear worked - the JARs in the lib directory are automatically included in the classpath. In the first C.ear, the A.jar would have to be included in the META-INF/application.xml file (you do have one of these, don't you?)

- That's the whole point...eclipse don't build the right structure when deploying on jboss...just put everything at root folder...

Also, which version of JBossAS?

- 4.2.2 GA
Jose Pereira
Greenhorn

Joined: Dec 10, 2002
Posts: 12
If you are using the Eclipse EAR Application Project, when you create the project using the wizard, dont forget to check the "Generate Deployment Descriptor" option in the second screen ... If you don't check this option it dose not create the applications.xml ...
Jose Pereira
Greenhorn

Joined: Dec 10, 2002
Posts: 12
One more thing, I found that when you use the "Default Configuration for JBoss v4.2" option when creating the Eclipse EAR Project the deployment dose not work so I created one using Minimum Configuration option and it worked.

Obvious things for a jobs that has no science to it .... :roll:
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

kidjim,
Please check your private messages about an important administrative matter.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse and ear files on jboss