Community   SpringSource   Projects    Downloads    Documentation    Forums    Training   Exchange   Blogs

Go Back   Spring Community Forums > Core Spring Projects > Core Container

Reply
 
Thread Tools Display Modes
  #1  
Old May 7th, 2009, 03:41 PM
fatboysuns fatboysuns is offline
Junior Member
 
Join Date: Jan 2008
Posts: 5
Default Context scanning on Jboss 5

Hi All,
When I use context scanning and deploy it on Jboss5. Spring somehow seem to have issue of finding the beans in the classpath. If the same war is dropped on Jboss 4.X it seems to Work just fine.

I tried using the newer Spring3 - m3 as well with no luck.

Any suggestions is appreciated.

-Sundar

Last edited by fatboysuns; May 7th, 2009 at 06:35 PM.
Reply With Quote
  #2  
Old May 8th, 2009, 06:08 AM
denis.zhdanov denis.zhdanov is offline
Senior Member
 
Join Date: May 2007
Location: Saint Petersburg, Russian Federation
Posts: 1,189
Default

Quote:
Originally Posted by fatboysuns View Post
Hi All,
When I use context scanning and deploy it on Jboss5. Spring somehow seem to have issue of finding the beans in the classpath. If the same war is dropped on Jboss 4.X it seems to Work just fine.

I tried using the newer Spring3 - m3 as well with no luck.

Any suggestions is appreciated.

-Sundar
Class loader used during component scanning is unable to find target classes.

Solution is to get the knowledge about jboss5 web app class loaders management and perform necessary configuration changes.

For more details about components scanning implementation you can check org.springframework.context.annotation.ClassPathBe anDefinitionScanner.doScan()
Reply With Quote
  #3  
Old May 8th, 2009, 06:31 AM
Marten Deinum Marten Deinum is offline
Senior Member
 
Join Date: Jun 2006
Location: The Netherlands
Posts: 9,521
Default

This could lead to unexpected issues when migrating to jboss 5. Could you also register a JIRA issue so that the spring guys can look into it for Spring 3.
__________________
Marten Deinum
  • Senior Java Consultant
  • SpringSource Certified Trainer
Conspect ICT diensten
Blog
LinkedIn
Use the [ code ] tags, young padawan
Reply With Quote
  #4  
Old May 8th, 2009, 11:26 AM
fatboysuns fatboysuns is offline
Junior Member
 
Join Date: Jan 2008
Posts: 5
Default

Hi Denis,
I did look into the doScan method. Whats happened with the new microkernel of jboss is that, instead of the classloader pointing to tmp/deploy/***war folder, it now points to server default deploy folder because of which the classLoader.get*** dont find anything and the "beanCountAtScanStart" seems to be zero.

Marten ,

There might already be a Jira for this I guess from this article.
http://daniel.gredler.net/2009/01/10...ring-256-boom/

Could you lemme know where i can post a Jira if there isnt one already. I am definitely looking forward to this being fixed in Spring 3.

Thanks for your support.

Appreciate your work
Sundar
Reply With Quote
  #5  
Old May 8th, 2009, 11:33 AM
fatboysuns fatboysuns is offline
Junior Member
 
Join Date: Jan 2008
Posts: 5
Default

This is the jira mentioned in the article

http://jira.springframework.org/brow...l#action_41972

It is related to EJB3 though. Could you lemme know if I should create another one please?
Reply With Quote
  #6  
Old Nov 17th, 2009, 08:14 PM
bhaveshbhatkar bhaveshbhatkar is offline
Junior Member
 
Join Date: Aug 2008
Posts: 1
Default Sundar please can you help me

Quote:
Originally Posted by fatboysuns View Post
Hi All,
When I use context scanning and deploy it on Jboss5. Spring somehow seem to have issue of finding the beans in the classpath. If the same war is dropped on Jboss 4.X it seems to Work just fine.

I tried using the newer Spring3 - m3 as well with no luck.

Any suggestions is appreciated.

-Sundar
====================

Hi sundar, I am also getting the exactly same problem , I am using spring3.0 and JBOSS5.1.0 , but it's not working, it works fien on tomcat, please could you help me ASAP.
Bhavesh
Reply With Quote
  #7  
Old Jan 21st, 2010, 02:29 AM
viggo.navarsete viggo.navarsete is offline
Junior Member
 
Join Date: Feb 2009
Posts: 8
Default

Any news on this problem?
I'm also having problems deploying a war to JBoss 5.1.0.GA that contains Spring for component scanning. I've read this blog
http://daniel.gredler.net/2009/01/10...ring-256-boom/
and also this issue
http://jira.springframework.org/browse/SPR-5120
and also tried to use Spring 3.0.0.RELEASE, but I still get the same error:
09:23:33,003 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@3095915...y/test-web.war/}
09:23:33,004 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@3095915...y/test-web.war/}
09:23:33,004 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@3095915...y/test-web.war/}
09:23:33,048 INFO [EjbDeployer] installing bean: ejb/#SequenceGenerator,uid8888655
09:23:33,048 INFO [EjbDeployer] with dependencies:
09:23:33,048 INFO [EjbDeployer] and supplies:
09:23:33,049 INFO [EjbDeployer] jndi:SequenceGenerator
09:23:33,049 INFO [EjbDeployer] installing bean: ejb/#Sequence,uid17064588
09:23:33,049 INFO [EjbDeployer] with dependencies:
09:23:33,049 INFO [EjbDeployer] and supplies:
09:23:33,049 INFO [EjbDeployer] jndi:Sequence
09:23:34,067 ERROR [AbstractKernelController] Error installing to Configured: name=jboss.j2ee:module="test-web.war",service=EjbModule state=Instantiated mode=Manual requiredState=Configured
java.lang.RuntimeException: Exception setting attribute WebServiceName on mbean jboss.j2ee:service=EjbModule,module="test-web.war"
at org.jboss.system.ServiceConfigurator.configure(Ser viceConfigurator.java:170)
at org.jboss.system.ServiceConfigurator.configure(Ser viceConfigurator.java:114)
at org.jboss.system.microcontainer.ConfigureAction.in stallAction(ConfigureAction.java:58)
at org.jboss.system.microcontainer.ConfigureAction.in stallAction(ConfigureAction.java:42)
at org.jboss.dependency.plugins.action.SimpleControll erContextAction.simpleInstallAction(SimpleControll erContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControll erContextAction.install(AccessControllerContextAct ion.java:71)
at org.jboss.dependency.plugins.AbstractControllerCon textActions.install(AbstractControllerContextActio ns.java:51)
at org.jboss.dependency.plugins.AbstractControllerCon text.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerC ontext.install(ServiceControllerContext.java:286)
at org.jboss.dependency.plugins.AbstractController.in stall(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.in crementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.ch ange(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.ch ange(AbstractController.java:553)
at org.jboss.system.ServiceController.doChange(Servic eController.java:688)
at org.jboss.system.ServiceController.install(Service Controller.java:274)
at org.jboss.system.deployers.ServiceDeployer.deploy( ServiceDeployer.java:90)
at org.jboss.system.deployers.ServiceDeployer.deploy( ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractS impleRealDeployer.internalDeploy(AbstractSimpleRea lDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractR ealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrap per.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImp l.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerCon text.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.in stall(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.in crementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.ch ange(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.ch ange(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImp l.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl. process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository. MainDeployerAdapter.process(MainDeployerAdapter.ja va:117)
at org.jboss.system.server.profileservice.hotdeploy.H DScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.H DScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndRe set(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(Future Task.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$101(ScheduledThreadPoolE xecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.runPeriodic(ScheduledThreadPool Executor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.management.InvalidAttributeValueException: Set attribute has class class javax.management.ObjectName loaded from null that is not assignable to attribute class class javax.management.ObjectName loaded from BaseClassLoader@178069d{vfszip:/opt/...y/test-web.war/}

This is really a blocker for me, any workaround that could help me?
I have tried to depend on the jboss-as-sprint-int, as it's told to solve the problems, but by just adding it as a dependency sure didn't work:
http://anonsvn.jboss.org/repos/repos...t-5.0.1.GA.pom

Any help would be appreciated
Reply With Quote
Reply

Tags
component-scan, context scan, context:component-scan

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:18 AM.


Contegix provides first-class managed hosting and partial sponsorship of these forums.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.