-
1. Re: ClassNotFound error for classes in spring archives lib directory
alesj Jan 28, 2010 6:48 AM (in response to mikekarrys)Which AS are you using?
.spring is treated as a plain .jar -- I think in both AS versions (I wrote both handlings, just forgot a bit about 4, on how I did it )
(a) for 5+ it's handled by JarStructure
(b) for 4 it's handled by SpringDeployer
and as such doesn't understand lib/ as a classpath entry.
On 5 the fix is easy, just use jboss-structure.xml.
On 4 it will not be that easy, you will have to re-structure your deployment.
-
2. Re: ClassNotFound error for classes in spring archives lib directory
mikekarrys Jan 28, 2010 1:18 PM (in response to alesj)Thanks for the help Ales.
I'm using AS 5.1.0.GA with the jboss-spring-3.2.deployer.
So after I wrote this I thought that maybe I should package everything in an EAR but when I do that the mavnen-ear-plugin packager converts my .spring to .jar and then can't resolve the spring context.
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/C:/Applications/jboss-5.1.0.GA/server/default/deploy/avm-ear.ear/" is in error due to the following reason(s): org.xml.sax.S
AXParseException: The prefix "context" for element "context:annotation-config" is not bound.The maven-ear-plugin puts the my .spring archive in as a .jar.
Does it need to be a .spring in the ear to deploy correctly or is it a configuration problem?
Thanks,
Mike
-
3. Re: ClassNotFound error for classes in spring archives lib directory
marius.bogoevici Jan 28, 2010 1:22 PM (in response to mikekarrys)Mike,
No, the ear file should be alright.
What's the name of your Spring configuration file, where is it placed. Can you just attach it (after removing sensitive bits. etc). I would just like to look at the header.
Thanks,
Marius
-
4. Re: ClassNotFound error for classes in spring archives lib directory
mikekarrys Jan 28, 2010 3:33 PM (in response to marius.bogoevici)Marius
After what you said I looked at the jboss-spring.xml that was in the deployed ear and it was wrong. I had to clear my Maven local repository before it would include the correct version. But anyway that is a Maven problem.
But now I get the following error at deployment.
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/C:/Applications/jboss-5.1.0.GA/server/default/deploy/avm-ear.ear/" is in error due to the following reason(s): org.xml.sax.S
AXParseException: cvc-complex-type.3.2.2: Attribute 'weaverclass' is not allowed to appear in element 'context:load-time-weaver'.I have included the top my jboss-spring.xml file. I am actually not sure how to use the JBoss5LoadTimeWeaver so I'm not even sure if this is the correct way or situation to use it. Can you give any insight into how and when to use the JBoss5LoadTimeWeaver?
Thanks in advance,
Mike
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <!-- post-processors for all standard config annotations --> <context:annotation-config /> <context:component-scan base-package="ngc.avm" /> <tx:annotation-driven /> <context:load-time-weaver weaverclass="org.jboss.instrument.classloading.JBoss5LoadTimeWeaver"/>