[JBoss AS7 Development] - How do I put an MBean in JNDI?
by Matt Drees
Matt Drees [http://community.jboss.org/people/matt.drees] created the discussion
"How do I put an MBean in JNDI?"
To view the discussion, visit: http://community.jboss.org/message/606799#606799
--------------------------------------------------------------
Hi all,
I'm trying to get a SAR deployed to AS7.
One of my MBeans is trying to bind itself into JNDI using NonSerializableFactory.rebind(name, this, true). This apparently works fine on older jboss releases, but on AS7 I get this:
13:30:22,405 WARN [org.ccci.ha.HighAvailabilityDataSource] (MSC service thread 1-4) Starting up HighAvailabilityDataSource ccpDatasource in PRIMARY mode
13:30:22,406 INFO [stdout] (MSC service thread 1-4) fullName=jdbc/ccpDatasource
13:30:22,406 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.mbean.service."jboss.jca:name=jdbc/ccpDatasource,service=DataSourceBinding".start: org.jboss.msc.service.StartException in service jboss.mbean.service."jboss.jca:name=jdbc/ccpDatasource,service=DataSourceBinding".start: Failed to execute legacy service start() method
at org.jboss.as.service.StartStopService.start(StartStopService.java:51)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.as.service.AbstractService.invokeLifecycleMethod(AbstractService.java:59)
at org.jboss.as.service.StartStopService.start(StartStopService.java:49)
... 4 more
Caused by: java.lang.UnsupportedOperationException: Naming context is read-only
at org.jboss.as.naming.NamingContext.rebind(NamingContext.java:227)
at javax.naming.InitialContext.rebind(InitialContext.java:408) [:1.6.0_24]
at org.jboss.util.naming.NonSerializableFactory.rebind(NonSerializableFactory.java:185)
at org.jboss.util.naming.NonSerializableFactory.rebind(NonSerializableFactory.java:250)
at org.ccci.ha.HighAvailabilityDataSource.rebind(HighAvailabilityDataSource.java:53)
at org.ccci.ha.HighAvailabilityDataSource.start(HighAvailabilityDataSource.java:34)
... 10 more
So, it looks like JNDI is read-only now. What is the recommended approach for making an MBean available in JNDI?
Or, perhaps I'm just going about this all the wrong way. What I really need is to make a custom javax.sql.Datasource available in JNDI, and I need to be able to do some logic on start-up. (I don't want to use JCA for this, since this datasource simply delegates to one of two other standard (JCA) datasources.) I'm sure I don't need this object to be an MBean, but that seemed the simplest thing at the time. Is there a better way to do this?
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/606799#606799]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[JBoss AS7 Development] - META-INF/services for module extensions - question/issue
by Dan Sirbu
Dan Sirbu [http://community.jboss.org/people/lmcdasi] created the discussion
"META-INF/services for module extensions - question/issue"
To view the discussion, visit: http://community.jboss.org/message/621332#621332
--------------------------------------------------------------
Hi,
I have create a module testmod that is stored into /home/jboss7/modules/com/mycomp/testmod/main with the appropriate jar file. The META-INF/services contains the necessary defition for a java service to be loaded.
I also create a testextension module that is stored into /home/jboss7/modules/com/mycomp/testextension/main. In testextenstion module.xml I add the dependency towards the testmod in order to have the classpath set properly.
I have 2 situations:
(a) If I set the testmod as a global module in the standalone.xml, the the META-INF/services class defined there is loaded and available to a war file since when I deploy the WAR file via the ServletContextListner I can bootstrap the spi.
(b) If I define the textextension in standalone.xml (and remove the global definition), then try to bootstrap the testmod from the testextension, then the META-INF/services is no longer loaded and the SPI is not working anylonger.
I am wondering if my test is valid. And if yes, what would be the reason that the testmod META-INF/services is not available to the textextension module. In the dependency definiton I tried : services="export" export="true" for example ( I try "import" too) but no luck.
Looking more carefully at the META-INF/services of the testextension module, there is one needed by jboss in order to kickstart the extension. And that get's called. So what I did, is to add the services from the testmod within the testextension -> still not luck.
And that sounds similar with : " https://issues.jboss.org/browse/AS7-4 https://issues.jboss.org/browse/AS7-4" - which tough looks to be old and addressed. I am using the GA version.
Any tips ?
BR,
Dan S.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/621332#621332]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[JBoss AS7 Development] - NPE when deploying on latest nightly build
by guinotphil
guinotphil [http://community.jboss.org/people/guinotphil] created the discussion
"NPE when deploying on latest nightly build"
To view the discussion, visit: http://community.jboss.org/message/623813#623813
--------------------------------------------------------------
Hello,
I've just downloaded the latest nighly build and tryed to deploy an EAR application with my fav app server....
When I start the server I just get the following error:
17:44:40,271 INFO [org.jboss.modules] JBoss Modules version 1.0.2.GA
17:44:40,499 INFO [org.jboss.msc] JBoss MSC version 1.0.1.GA
17:44:40,537 INFO [org.jboss.as] JBoss AS 7.1.0.Alpha1-SNAPSHOT "Lightning" starting
17:44:41,257 WARN [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.
17:44:41,307 INFO [org.jboss.as] creating http management service using network interface (management-web) port (9990)
17:44:41,308 WARN [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.
17:44:41,314 INFO [org.jboss.as.logging] Removing bootstrap log handlers
17:44:48,720 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."EAR_Project.ear"."ejbModule.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."EAR_Project.ear"."ejbModule.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "ejbModule.jar" of deployment "EAR_Project.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
Caused by: java.lang.NullPointerException
at org.jboss.invocation.proxy.MethodIdentifier.<init>(MethodIdentifier.java:82)
at org.jboss.invocation.proxy.MethodIdentifier.getIdentifierForMethod(MethodIdentifier.java:212)
at org.jboss.as.ejb3.deployment.processors.merging.TransactionAttributeMergingProcessor.processTransactionAttributeAnnotation(TransactionAttributeMergingProcessor.java:87)
at org.jboss.as.ejb3.deployment.processors.merging.TransactionAttributeMergingProcessor.handleAnnotations(TransactionAttributeMergingProcessor.java:61)
at org.jboss.as.ejb3.deployment.processors.merging.AbstractMergingProcessor.processComponentConfig(AbstractMergingProcessor.java:87)
at org.jboss.as.ejb3.deployment.processors.merging.AbstractMergingProcessor.deploy(AbstractMergingProcessor.java:72)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
... 5 more
The previous version I was using was from August 15th or 16th and I could deploy the application fine...
I guess it must be something wrong in an annotation, but I don't really know how to debug this...
Thank you for your help !
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/623813#623813]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months