tags:

views:

94

answers:

2

Hi,

I've got problems starting my WAR application on a local JBoss. After two other EARs are deployed and the TomcatDeployer begins deploying the WAR, I'm getting the following error message:

2010-04-28 10:01:56,605 ERROR [org.jboss.ejb.plugins.LogInterceptor] [] [main] EJBException in method: public abstract at.sozvers.stp.zpv.ejb.lea.rwsuc.EJBLeaRegelwerkSuchenRemote at.sozvers.stp.zpv.ejb.lea.rwsuc.EJBLeaRegelwerkSuchenHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException, causedBy: javax.ejb.EJBException: org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:applicationContext.xml], factory key [contextService]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextService' defined in URL [jar:file:/C:/ta30/nutzb/jboss-4.2.3.GA.ZPV/server/default/deploy/deploy.last/zpv-app-web-frontend-1.0-SNAPSHOT.war/WEB-INF/lib/zpv-comp-ejb-modules-1.0-SNAPSHOT-client.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [at/sozvers/stp/zpv/dao/ContextBasic.xml]; nested exception is java.io.FileNotFoundException: class path resource [at/sozvers/stp/zpv/dao/ContextBasic.xml] cannot be opened because it does not exist

The sad thing is that the resource at/sozvers/stp/zpv/dao/ContextBasic.xml actually is placed in a JAR in one of my EAR files which should be deployed before the WAR. And at least I get a message that the deployment of the EAR has been successful. I also looked into the JAR with my file archiver and the ContextBasic.xml is indeed there at the right place.

Is there a way for me to get sure that the JAR, not the EAR as a whole, is really deployed to the JBoss? I'm already starting to lose my head about this issue.

Thank you. Bernhard

+1  A: 

Could be a classloader issue. You can check whether your JAR and its contents are loaded properly by configuring a logger for classloading events, as described here (example 3.8).

The log also gives you information about which classloader loaded what - this might explain why your web app (loaded by its own loader) does not see stuff within the EAR.

Another thing: is the JAR containing the XML file included in the classpath of the WAR?

Péter Török
I've now added a logger for the classloading events which generates a big log file, but I don't really know what to look for. I've searched for the "ContextBasic.xml" file but only found one in a different jar (which is placed there correctly), not in the one I hoped for. Or am I doing it wrong anyway?As I've written above, the same EARs and the WAR that are working for me colleague fail at my JBoss ... :-(
Bernhard V
You should search for the name of the jar file in question. Obviously ContextBasic.xml will not be loaded from it, otherwise you weren't experiencing this problem. Another thing to try is to compare the two JBoss deployments to see if the JBoss version, conf files, lib files etc. are the same - there must be some difference outside the EAR and WAR files which causes the failure in your environment.
Péter Török
A: 

I have deployed my war in another deploy directory called "deploy.last" in the JBoss directory, since it has to be -- as the name suggests -- deployed at last. Now I've changed my JBoss configuration and put the war in the higher-ranking deploy directory (where the two EARs are too) and everything is working fine now. The war is still deployed at last. I don't have an idea why this worked, but it worked. :D

Bernhard V