[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: EJB not deployed in EAR file with libraries

antonio.genghi do-not-reply at jboss.com
Fri Nov 14 04:22:28 EST 2008


"jaikiran" wrote : <?xml version="1.0" encoding="UTF-8"?>
  |   | <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.s
  |   | un.com/dtd/application_1_3.dtd'>
  |   | <application>
  |   |   <display-name>myApp</display-name>
  |   |   <description>Application description</description>
  |   |   <module>
  |   |     <ejb>myEjb.jar</ejb>
  |   |   </module>
  |   |   <library-directory>lib</library-directory>
  |   | </application>	
  | Point#1 - The library-directory is not meant to be in the application.xml. Instead it should be in the jboss-app.xml:
  | 
  | <jboss-app>
  |   |   <library-directory>lib</library-directory>
  |   | </jboss-app>
  | 
  | Fix the application.xml to remove that element and create a jboss-app.xml file with the above contents in the EAR/META-INF folder.
  | 

Really? Why i should put library directory in jboss-app.xml instead of application.xml? J2ee standard say library directory shoul declared in application.xml. Btw, i tried to put in jboss-app, but don't know why, jboss refuses to load the correct schema to read xml, and refuses to parse library directory.
But it is that problem, because jboss correctly read lib directory (i'm debugging whole deploy chain and i've seen with my eye jboss read my util*.jar :) )


"jaikiran" wrote : 
  | Next, what do the util*.jar contain? And finally, do you see any exceptions in the logs? If yes, then please post the same. Please also post the logs, from the point where your application starts getting deployed.
  | 

Well, util*.jar are two stupid library such as could be log4j, or any other jar containing classes. Nothing more, nothing less.

I continued to debug the deployer chain, and i noticed that JBoss "fails" in these:
It reads the EAR file
Deploy EAR
Search in application.xml modules and library.
Find 2 libraries and a deployable module
Unpack the EAR in the tmp directory
Search the correct deployer for the module found.
Now comes the problem
When EJBDeployer is asked to accepts myEJB.jar (located in the EAR tmp directory), it refuse to accept because it cannot read META-INF/ejb.jar from archive.

But obviously, if i open the file and search for ejb-jar, i found it.

It seems like an issue with classloading.

Here it is the incriminated lines in EJBDeployer:

  |       // However the jar must also contain at least one ejb-jar.xml
  |       boolean accepts = false;
  |       try
  |       {
  |          URL dd = di.localCl.findResource("META-INF/ejb-jar.xml");
  |          if (dd == null)
  |          {
  |             return false;
  |          }
  | 

di.locaCl is created in the MainDeployer in that way:

  |       log.debug("Starting deployment (init step) of package at: " + deployment.url);
  |       try
  |       {
  |          // Create a local copy of that File, the sdi keeps track of the copy directory
  |          if (deployment.localUrl == null)
  |          {
  |             makeLocalCopy(deployment);
  |             URL[] localCl = new URL[]{deployment.localUrl};
  |             deployment.localCl = new URLClassLoader(localCl);
  |          }
  | 

where localurl is the file in the tmp directory of EAR unpacked.

Any idea???

Thanks a lot!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189317#4189317

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4189317



More information about the jboss-user mailing list