[Management, JMX/JBoss] - Class loader problem!
by Doug.Palmer
Hi
I'm running into a class loading problem with a service that I'm developing. The service builds war files from data in an xml document and then deploys asks the main deployer to deploy the war file.
The following works in the create method my deployment MBean:
| ....code to generate warfile....
| mainDeployer.deploy(warFile.getPath());
|
However, this does not establish a connection between the original xml deployment and the war file deployment. So I tried the following:
| ....code to generate warfile....
| DeploymentInfo subDi = new DeploymentInfo(new URL("file://" + outFile.getPath()), di, server);
| mainDeployer.deploy(subDi);
|
Now, when I try to connect to the newly create web service I get the following exception:
| java.lang.ClassCastException: decs2.pi.ProcessInitiatorImpl
| at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055)
| at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:613)
|
Where decs2.pi.ProcessInitiatorImpl is the code the implements my service. The class file for decs2.pi.ProcessInitiatorImpl resides in the jar file with my MBean.
Does anyone know how to solve this class loading issue?
Regards
Doug
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969278#3969278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969278
19 years, 7 months
[JBossWS] - Patient is more dead then alive? jax-rpc Handler that is.
by Arno Werr
Hi gents,
Here we go. EJB3 with web service annotations
| @WebService(name = "Test", serviceName = "TestService")
| @WebServiceRef(name = "service/TestService")
| @HandlerChain(file = "http://localhost/servers/jboss/handlers.xml", name = "")
| @Stateless
| public class TestWebService implements TestSEI {
| private Logger logger;
|
| @PostConstruct
| public void postConstruct() {
| logger = Logger.getLogger(getClass());
| }
|
| @WebMethod
| @Oneway
| public void test(@WebParam(name = "TEST")
| String input) {
| logger.debug("test() called with input: " + input);
|
| }
| }
|
Simple, hah? Note @HandlerChain(file = "http://localhost/servers/jboss/handlers.xml", name = "") Any other protocol - flat dead - FileNotFoundException. The same issue see: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=85018
Handler
| public class LoggingHandler extends GenericHandler {
| private Logger logger = Logger.getLogger(getClass());
|
| public QName[] getHeaders() {
| return null;
| }
|
| public boolean handleRequest(MessageContext context) {
| logger.debug("handleRequest() " + context);
| SOAPMessageContext smc = (SOAPMessageContext) context;
| SOAPMessage msg = smc.getMessage();
|
| try {
| SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
| SOAPHeader header = envelope.getHeader();
|
| logger.debug("We are here ");
|
| } catch (SOAPException e) {
| throw new JAXRPCException(e);
| }
| return true;
| }
| }
|
No brainer.
Now - handlers.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <jws:handler-config xmlns:jws="http://java.sun.com/xml/ns/javaee">
| <jws:handler-chains>
| <jws:handler-chain>
| <jws:handler>
| <jws:handler-class>
| <![CDATA[org.jboss.tutorial.ee.service.impl.ws.handler.LoggingHandler]]>
| </jws:handler-class>
| </jws:handler>
| </jws:handler-chain>
| </jws:handler-chains>
| </jws:handler-config>
|
It's there. I made sure I can get it from my browser http://localhost/servers/jboss/handlers.xml.
Now, trying to deploy on JBoss
| 13:40:26,736 INFO [Server] Release ID: JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
|
| Specification-Title: JBossWS
| Specification-Version: jbossws-1.0
| Specification-Vendor: JBoss (http://www.jboss.org)
| Implementation-Title: JBoss Web Services (JBossWS)
| Implementation-URL: http://www.jboss.org/products/jbossws
| Implementation-Version: jbossws-1.0.0.GA (date=200604281743)
| Implementation-Vendor: JBoss Inc.
| Implementation-Vendor-Id: http://www.jboss.org
|
Fire it up. Boom!!!
| 2006-09-04 13:41:34,256 WARN [org.jboss.ws.metadata.EndpointMetaData] Cannot obtain style, using default: document
| 2006-09-04 13:41:34,258 DEBUG [org.jboss.ws.jaxrpc.ParameterWrapping] Generating wrapper: org.jboss.tutorial.ee.service.impl.ws.__JBossWS_TestService_TestPort_test
| 2006-09-04 13:41:34,851 ERROR [org.jboss.deployment.MainDeployer] Could not create deployment: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/tmp/deploy/tmp49972jspring.ear-contents/facade.jar
| java.lang.NullPointerException
| at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processHandlerChain(AnnotationsMetaDataBuilder.java:545)
| at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:164)
| at org.jboss.ws.metadata.AnnotationsMetaDataBuilderEJB3.buildMetaData(AnnotationsMetaDataBuilderEJB3.java:93)
| at org.jboss.ws.server.WebServiceDeployerEJB3.createWebServicesMetaData(WebServiceDeployerEJB3.java:91)
| at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy36.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:464)
| at java.lang.Thread.run(Thread.java:595)
| 2006-09-04 13:41:34,890 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
| 2006-09-04 13:41:34,890 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
| 2006-09-04 13:41:34,894 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
| 2006-09-04 13:41:34,896 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@f8f8ff32{ url=file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear, deployedLastModified=0 }
| org.jboss.deployment.DeploymentException: Could not create deployment: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/tmp/deploy/tmp49972jspring.ear-contents/facade.jar; - nested throwable: (java.lang.NullPointerException)
| at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:975)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:464)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.NullPointerException
| at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processHandlerChain(AnnotationsMetaDataBuilder.java:545)
| at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnnotations(AnnotationsMetaDataBuilder.java:164)
| at org.jboss.ws.metadata.AnnotationsMetaDataBuilderEJB3.buildMetaData(AnnotationsMetaDataBuilderEJB3.java:93)
| at org.jboss.ws.server.WebServiceDeployerEJB3.createWebServicesMetaData(WebServiceDeployerEJB3.java:91)
| at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy36.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| ... 69 more
| 2006-09-04 13:41:34,898 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear -> file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear
| 2006-09-04 13:41:34,900 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
|
| --- Incompletely deployed packages ---
| org.jboss.deployment.DeploymentInfo@f8f8ff32 { url=file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear }
| deployer: org.jboss.deployment.EARDeployer@192425a
| status: Deployment FAILED reason: Could not create deployment: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/tmp/deploy/tmp49972jspring.ear-contents/facade.jar; - nested throwable: (java.lang.NullPointerException)
| state: FAILED
| watch: file:/home/iouri/java/server/JBoss/jboss-4.0.4/server/spring/deploy/jspring.ear
| altDD: null
| lastDeployed: 1157391683378
| lastModified: 1157391682000
| mbeans:
|
|
| 2006-09-04 13:41:34,987 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Notified that enabled: true
| 2006-09-04 13:41:34,987 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Started jboss.deployment:type=DeploymentScanner,flavor=URL
| 2006-09-04 13:41:34,987 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
| 2006-09-04 13:41:34,988 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: jboss-service.xml
|
Commented out reference to a handler chain. Everything works just fine. So, we do not have handlers on JBoss 4.0.4, right? Or where do I goof up?
Any ideas?
Cheers,
Arno
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969277#3969277
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969277
19 years, 7 months
[EJB 3.0] - How to efficiently page object with initialized collections
by pmpm
Hi,
I have an entity bean with a collection of items.
| @OneToMany(cascade = { CascadeType.ALL}, fetch = FetchType.LAZY, mappedBy ="invoice")
| @BatchSize( size = 10)
| public List<Item> getItems()
| {
| return items;
| }
|
Everything works fine in everyday use. But ocassionaly I would like to perform statistics, which is done through selecting all the entities and performing operation on their items.
Because there is a large number of objects I have to page through them in order to not to run out of memory. I made two attempts to solve this problems but both are unefficient and my method timeouts.
First approach.
My query looks like:
| "select e from Example join fetch e.items where ..."
|
Then I page through the result set and make my computations on result objects:
| int resIt = 0;
| List<Example> rl = null;
| do
| {
|
| rl = q.setMaxResults( 1000).setFirstResult(resIt).getResultList();
|
| for (Example e: (List<Example>) rl)
| {
| //my code
| }
|
| resIt += rl.size();
| entityManager.clear();
|
| } while (rl.size() > 0);
|
But then I got a warning "firstResult / maxResults specified with collection fetch ; applying in memory". I uderstand that when collection is fetched, Hibernate cannot use sql "limit" because number of rows is not equal to number of objects, and "in memory" means additional selects.
Second approach.
I removed join fetch from query. But then items collection are fetched ( in batch of 10) during computatins, which is also slow. I dont want to change the value of batch in mapping.
Do you see any solution to my problem? Maybe there is a way to temporarily increase the batch size of the collection (for the duration of my statistics method)?
Thanks in advance
Pawel Miniewicz
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969272#3969272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969272
19 years, 7 months
[JBoss Seam] - Re: Step-by-step localization guide
by nhpvti
"perwik" wrote : One option would be to see each static content item as one object and then connect a number of translations to it. Then you show the translation corresponding to the current locale using the same rules as the properties files (i.e showing the default locale when the selected locale is not in the list of supported locales).
Thank you for the idea, but maintenance question is still open in this case. Or how are you going to populate this object with content: from a data base? Then a custom-made CMS would be necessary to maintain texts in the database...
By the way content can require for example html to be included. Properties files don't allow entering html according to my quick test.
So I would prefer simple <ui:include> tag:
<div class="header"><ui:include src="/WEB-INF/layout/header#{messages['application.fileSuffix']}.xhtml" /></div>
Any concerns?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969271#3969271
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969271
19 years, 7 months
[JBoss Seam] - TestNG and Seam Documentation 12.1. Unit testing Seam compon
by ffischer
Is it possible that the unit test example in the seam documentation, Paragraph 12.1 is out of date?
1. I have to extend SeamTest to get it work at all
2. If I try to set up the entityManager within an method annotated with @Configuration(beforeTestClass=true), I get the following exception. What do I miss?
INFO 04-09 19:05:46,558 (Log4JLogger.java:info:94) -Hibernate EntityManager 3.2.0.CR1
INFO 04-09 19:05:46,584 (Log4JLogger.java:info:94) -Hibernate Annotations 3.2.0.CR1
INFO 04-09 19:05:46,603 (Log4JLogger.java:info:94) -Hibernate 3.2 cr2
INFO 04-09 19:05:46,608 (Log4JLogger.java:info:94) -hibernate.properties not found
INFO 04-09 19:05:46,615 (Log4JLogger.java:info:94) -Bytecode provider name : cglib
INFO 04-09 19:05:46,622 (Log4JLogger.java:info:94) -using JDK 1.4 java.sql.Timestamp handling
FATAL 04-09 19:05:47,047 (Log4JLogger.java:fatal:124) -net/ipcore/irp/model/test/integr/cm/testng.xmlO-:-Ofalse
FATAL 04-09 19:05:47,102 (Log4JLogger.java:fatal:124) -seam.propertiesO-:-Ofalse
FATAL 04-09 19:05:47,104 (Log4JLogger.java:fatal:124) -components.propertiesO-:-Ofalse
FATAL 04-09 19:05:47,104 (Log4JLogger.java:fatal:124) -WEB-INF/web.xmlO-:-Ofalse
FATAL 04-09 19:05:47,106 (Log4JLogger.java:fatal:124) -WEB-INF/faces-config.xmlO-:-Ofalse
FATAL 04-09 19:05:47,108 (Log4JLogger.java:fatal:124) -WEB-INF/components.xmlO-:-Ofalse
FATAL 04-09 19:05:47,110 (Log4JLogger.java:fatal:124) -META-INF/persistence.xmlO-:-Ofalse
FATAL 04-09 19:05:47,111 (Log4JLogger.java:fatal:124) -META-INF/jboss-app.xmlO-:-Ofalse
FATAL 04-09 19:05:47,112 (Log4JLogger.java:fatal:124) -META-INF/ejb-jar.xmlO-:-Ofalse
FATAL 04-09 19:05:47,113 (Log4JLogger.java:fatal:124) -META-INF/application.xmlO-:-Ofalse
FATAL 04-09 19:05:47,114 (Log4JLogger.java:fatal:124) -META-INF/.#persistence.xml.1.1O-:-Ofalse
INFO 04-09 19:05:47,266 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.Subject
INFO 04-09 19:05:47,300 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.Subject on table subject
INFO 04-09 19:05:47,414 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.LegalPerson
INFO 04-09 19:05:47,417 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.LegalPerson on table legal_person
INFO 04-09 19:05:47,465 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.RegistrationProvider
INFO 04-09 19:05:47,469 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.RegistrationProvider on table reg_provider
INFO 04-09 19:05:47,470 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.Person
INFO 04-09 19:05:47,471 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.Person on table person
INFO 04-09 19:05:47,477 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.faktura.Article
INFO 04-09 19:05:47,480 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.faktura.Article on table article
INFO 04-09 19:05:47,494 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.product.Configuration
INFO 04-09 19:05:47,495 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.product.Configuration on table configuration
INFO 04-09 19:05:47,499 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.Address
INFO 04-09 19:05:47,503 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.Address on table address
INFO 04-09 19:05:47,515 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.PostalAddress
INFO 04-09 19:05:47,519 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.PostalAddress on table postal_address
INFO 04-09 19:05:47,539 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.finance.BankingAccount
INFO 04-09 19:05:47,542 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.finance.BankingAccount on table banking_account
INFO 04-09 19:05:47,557 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.finance.FiscalData
INFO 04-09 19:05:47,560 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.finance.FiscalData on table fiscal_data
INFO 04-09 19:05:47,563 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.faktura.PurchaseOrderItem
INFO 04-09 19:05:47,564 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.faktura.PurchaseOrderItem on table purchase_order_item
INFO 04-09 19:05:47,570 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.User
INFO 04-09 19:05:47,572 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.User on table user
INFO 04-09 19:05:47,650 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.faktura.PurchaseOrder
INFO 04-09 19:05:47,651 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.faktura.PurchaseOrder on table purchase_order
INFO 04-09 19:05:47,654 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.product.Product
INFO 04-09 19:05:47,655 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.product.Product on table product
INFO 04-09 19:05:47,662 (Log4JLogger.java:info:94) -Binding entity from annotated class: net.ipcore.irp.model.cm.CommAddress
INFO 04-09 19:05:47,663 (Log4JLogger.java:info:94) -Bind entity net.ipcore.irp.model.cm.CommAddress on table comm_address
INFO 04-09 19:05:47,922 (Log4JLogger.java:info:94) -Mapping collection: net.ipcore.irp.model.cm.Subject.bankingAccounts -> banking_account
INFO 04-09 19:05:47,926 (Log4JLogger.java:info:94) -Mapping collection: net.ipcore.irp.model.cm.Subject.orders -> purchase_order
INFO 04-09 19:05:48,142 (Log4JLogger.java:info:94) -JNDI InitialContext properties:{}
ERROR 04-09 19:05:48,160 (Log4JLogger.java:error:119) -Could not obtain initial context
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:175)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at net.ipcore.irp.model.test.unit.cm.CmUnitTest.init(CmUnitTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:322)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:156)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:97)
at org.testng.TestRunner.privateRun(TestRunner.java:693)
at org.testng.TestRunner.run(TestRunner.java:574)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:241)
at org.testng.SuiteRunner.run(SuiteRunner.java:145)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901)
at org.testng.TestNG.runSuitesLocally(TestNG.java:863)
at org.testng.TestNG.run(TestNG.java:613)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:85)
at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:127)
FATAL 04-09 19:05:48,166 (Log4JLogger.java:fatal:129) -Could not find datasource: java:/DefaultDS
javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:175)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at net.ipcore.irp.model.test.unit.cm.CmUnitTest.init(CmUnitTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:322)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:156)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:97)
at org.testng.TestRunner.privateRun(TestRunner.java:693)
at org.testng.TestRunner.run(TestRunner.java:574)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:241)
at org.testng.SuiteRunner.run(SuiteRunner.java:145)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901)
at org.testng.TestNG.runSuitesLocally(TestNG.java:863)
at org.testng.TestNG.run(TestNG.java:613)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:85)
at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:127)
Creating /home/ff/projects/irp-seam/tmp/test-output/irp-seam/net.ipcore.irp.model.test.unit.cm.CmUnitTest.html
FAILED: init
javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at net.ipcore.irp.model.test.unit.cm.CmUnitTest.init(CmUnitTest.java:39)
Caused by: org.hibernate.HibernateException: Could not find datasource
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
... 21 more
Caused by: javax.naming.NamingException: Local server is not initialized
at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:175)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
... 30 more
... Removed 17 stack frames
FAILED: end
java.lang.NullPointerException
at org.jboss.seam.contexts.WebApplicationContext.get(WebApplicationContext.java:47)
at org.jboss.seam.contexts.WebApplicationContext.get(WebApplicationContext.java:80)
at org.jboss.seam.core.Init.instance(Init.java:50)
at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1283)
at org.jboss.seam.Component.getInstance(Component.java:1260)
at org.jboss.seam.Component.getInstance(Component.java:1253)
at org.jboss.seam.Component.getInstance(Component.java:1235)
at org.jboss.seam.core.Manager.instance(Manager.java:303)
at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:187)
at org.jboss.seam.mock.SeamTest.end(SeamTest.java:297)
... Removed 19 stack frames
SKIPPED: testUser
SKIPPED: reopenUser
SKIPPED: destroy
SKIPPED: cleanup
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969270#3969270
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969270
19 years, 7 months