Exception while integrating spring and jboss 5.01 AS
seleshmaster Apr 12, 2009 9:35 AMI read and followed the instruction outlined by Ales Justin to integrate Jboss and spring. I am using Jboss 5.01 and Spring 2.5.
Here is what I did.
1) I copied jboss-spring-jdk5.deployer into JBOSS_HOME/server/deploy directory and the directory contains the follwoing:
jboss-spring-jdk5.deployer/ jboss-spring-jdk5.jar META-INF/ jboss-service.xml spring-aop.jar spring-beans.jar spring-context.jar spring-core.jar
2) I edited the ejb3-interceptors-aop.xml in my JBOSS_HOME/server/default/deploy directory:
I added the follwoing
<interceptor class="org.jboss.spring.interceptor.SpringInjectionInterceptor" scope="PER_VM"/>
I could not locate the follwing entry in the ejb3-interceptors-aop.xml so I just ingnored it (Anyway, I don't think I need to do anything here)
<typedef name="ejb3intercepted" expr="class(@javax.ejb.Interceptors) OR class(@javax.ejb.Interceptor) OR has(* *->@javax.ejb.AroundInvoke(..))"/>
I added the pointcut entry for every domain name expression.
<domain name="Stateless Bean"> <bind pointcut="execution(*->new(..))"> <interceptor-ref name="org.jboss.spring.interceptor.SpringInjectionInterceptor"/> </bind>
3) finally I started Jboss 5.01 server and deployed JBoss-Spring.ear file by coping it in the default/deploy directory
the ear file contains the following:
0 Mon Jun 05 15:43:24 EDT 2006 META-INF/ 103 Mon Jun 05 15:43:22 EDT 2006 META-INF/MANIFEST.MF 695 Tue Aug 09 10:46:56 EDT 2005 META-INF/application.xml 3562 Mon Jun 05 15:43:24 EDT 2006 business.ejb3 5978 Mon Jun 05 15:43:22 EDT 2006 spring-pojo.spring 4821 Mon Jun 05 15:43:24 EDT 2006 web.war
but I am getting the following exception
07:57:09,694 WARN [HDScanner] Scan failed
org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(JBoss-Spring.ear)
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:85)
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:1000)
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeploymentContext(MainDeployerImpl.java:440)
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:390)
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:300)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:267)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.RuntimeException: Error determining structure: JBoss-Spring.ear
at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:293)
at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:73)
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:196)
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:221)
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
... 15 more
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://java.sun.com/xml/ns/j2ee}application is not bound as a global element.
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:183)
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:161)
at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:160)
... 19 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/j2ee}application is not bound as a global element.
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:667)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
... 22 more
can someone help please? am I missing something?