[JBossWS] - Re: avoid lazy-initialization exceptions
by mazzï¼ jboss.com
The SLSB and entity is very simple. I've included the relevant SLSB interface definition and entity code below. The specific issue here is our login() method returns a Subject - and the Subject, although it has a Role relationship, we do not eagerly load it. The caller to login() never needs to know the role relationship data, and because of that, we increase performance by never asking the persistence layer to load that data before returning the Subject. While this is a very specific example, this design paradigm is all through our code. In fact, I have to believe this is a general problem everyone will have (since this is a big reason behind using LAZY vs. EAGER loading).
Not sure how to annotate the entity, because would that mean we can either ALWAYS or NEVER the data? But we know will we need it sometimes, but not always (i.e. sometimes a caller will call a different method that returns a Subject and that Subject WILL have the role information loaded and we thus WILL want that data go through the JAXB engine and returned to the web client).
I think we need some way to customize the way JAXB processes the returned entity or we need some annotation on a per-SLSB method. We are looking at @XMLJavaTypeAdapter as a possible way to do something, but we aren't sure yet until we try it out.
@WebService
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
| public interface SubjectManagerRemote {
| @WebMethod
| Subject login(String user, String password);
@Entity
| @Table(name = "ON_SUBJECT")
| public class Subject implements Externalizable {
| ...
| @ManyToMany
| @JoinTable(name="ON_SUBJECT_ROLE_MAP",
| joinColumns={@JoinColumn(name="SUBJECT_ID")},
| inverseJoinColumns={@JoinColumn(name="ROLE_ID")})
| private java.util.Set<Role> roles;
| ...
| public java.util.Set<Role> getRoles() {
| return this.roles;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098807#4098807
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098807
18Â years, 6Â months
[EJB 3.0] - Re: service=EJB3 + is already registered
by Jihnd
hi,
I'm having the same problem here too, was wondering if anone had found a resolution - i've no jndi properties in my jar
its an ejb thats been working fine so far but since i tried to expose it as a webservice, all sorts of funky stuff been happening.
i've included some of my server log, i'm pretty stuck here, and this seems to be the only discussion google can throw up
13:29:48,078 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
| 13:29:48,312 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
| 13:29:48,453 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=java/OracleDS' to JNDI name 'java/OracleDS'
| 13:29:51,546 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=AVmanBean.jar
| java.lang.IllegalStateException: Container jboss.j2ee:jar=AVmanBean.jar,name=AVmanBean,service=EJB3 + is already registered
| at org.jboss.ejb3.Ejb3Registry.register(Ejb3Registry.java:80)
| at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:494)
| at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:442)
| at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:423)
| at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:384)
| at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:327)
| at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
| at sun.reflect.GeneratedMethodAccessor3.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.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.create(Unknown Source)
| at org.jboss.system.ServiceController.create(ServiceController.java:330)
| at org.jboss.system.ServiceController.create(ServiceController.java:273)
| at sun.reflect.GeneratedMethodAccessor2.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.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 $Proxy33.create(Unknown Source)
| at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:492)
| 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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:76)
| 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 $Proxy34.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor19.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 $Proxy9.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.GeneratedMethodAccessor3.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.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.GeneratedMethodAccessor8.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.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:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| 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:508)
| at java.lang.Thread.run(Thread.java:595)
| 13:29:51,593 INFO [EJB3Deployer] Deployed: file:/C:/jboss/server/default/deploy/AVmanBean.jar
| 13:29:53,703 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss/server/default/data/wsdl/AVmanBean.jar/AVmanBean5821.wsdl
| 13:29:53,781 INFO [DefaultEndpointRegistry] register: jboss.ws:context=AVmanBean,endpoint=AVmanBean
| 13:29:53,843 INFO [TomcatDeployer] deploy, ctxPath=/AVmanBean, warUrl=.../tmp/deploy/AVmanBean.jar5823.war/
| 13:29:54,093 ERROR [MainDeployer] Could not start deployment: file:/C:/jboss/server/default/deploy/AVmanBean.jar
| javax.xml.ws.WebServiceException: Cannot find service endpoint target: jboss.j2ee:name=AVmanBean,service=EJB3,jar=AVmanBean.jar
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.init(InvocationHandlerEJB3.java:83)
| at org.jboss.wsf.framework.deployment.DefaultLifecycleHandler.create(DefaultLifecycleHandler.java:51)
| at org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect.create(EndpointLifecycleDeploymentAspect.java:42)
| at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
| at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| 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 $Proxy34.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor19.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 $Proxy9.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.GeneratedMethodAccessor3.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.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.GeneratedMethodAccessor8.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.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:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| 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:508)
| at java.lang.Thread.run(Thread.java:595)
| 13:29:54,203 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
| 13:29:54,468 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
|
| --- Packages waiting for a deployer ---
| org.jboss.deployment.DeploymentInfo@5ad7de9e { url=file:/C:/jboss/server/default/deploy/Desktop.ini }
| deployer: null
| status: null
| state: INIT_WAITING_DEPLOYER
| watch: file:/C:/jboss/server/default/deploy/Desktop.ini
| altDD: null
| lastDeployed: 1193315394468
| lastModified: 1193315394468
| mbeans:
|
| --- Incompletely deployed packages ---
| org.jboss.deployment.DeploymentInfo@5e724e6e { url=file:/C:/jboss/server/default/deploy/AVmanBean.jar }
| deployer: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
| status: Deployment FAILED reason: Cannot find service endpoint target: jboss.j2ee:name=AVmanBean,service=EJB3,jar=AVmanBean.jar
| state: FAILED
| watch: file:/C:/jboss/server/default/deploy/AVmanBean.jar
| altDD: null
| lastDeployed: 1193315391296
| lastModified: 1193315389109
| mbeans:
|
| org.jboss.deployment.DeploymentInfo@5ad7de9e { url=file:/C:/jboss/server/default/deploy/Desktop.ini }
| deployer: null
| status: null
| state: INIT_WAITING_DEPLOYER
| watch: file:/C:/jboss/server/default/deploy/Desktop.ini
| altDD: null
| lastDeployed: 1193315394468
| lastModified: 1193315394468
| mbeans:
|
| --- MBeans waiting for other MBeans ---
| ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=Invoker
| jboss.web:service=WebServer
|
| ObjectName: jboss:service=juddi
| State: CONFIGURED
| I Depend On:
| jboss.jca:service=DataSourceBinding,name=OracleDS
|
| ObjectName: jboss.mq:service=StateManager
| State: CONFIGURED
| I Depend On:
| jboss.jca:service=DataSourceBinding,name=OracleDS
| Depends On Me:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq:service=DestinationManager
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=MessageCache
| jboss.mq:service=PersistenceManager
| jboss.mq:service=StateManager
| jboss.mq:service=ThreadPool
| jboss:service=Naming
| Depends On Me:
| jboss.mq.destination:service=Topic,name=testTopic
| jboss.mq.destination:service=Topic,name=securedTopic
| jboss.mq.destination:service=Topic,name=testDurableTopic
| jboss.mq.destination:service=Queue,name=testQueue
| jboss.mq.destination:service=Queue,name=A
| jboss.mq.destination:service=Queue,name=B
| jboss.mq.destination:service=Queue,name=C
| jboss.mq.destination:service=Queue,name=D
| jboss.mq.destination:service=Queue,name=ex
| jboss.mq:service=SecurityManager
| jboss.mq.destination:service=Queue,name=DLQ
|
| ObjectName: jboss.mq:service=PersistenceManager
| State: CONFIGURED
| I Depend On:
| jboss.jca:service=DataSourceBinding,name=OracleDS
| Depends On Me:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq.destination:service=Topic,name=testTopic
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
| jboss.mq:service=SecurityManager
|
| ObjectName: jboss.mq.destination:service=Topic,name=securedTopic
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
| jboss.mq:service=SecurityManager
|
| ObjectName: jboss.mq.destination:service=Topic,name=testDurableTopic
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
| jboss.mq:service=SecurityManager
|
| ObjectName: jboss.mq.destination:service=Queue,name=testQueue
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
| jboss.mq:service=SecurityManager
|
| ObjectName: jboss.mq.destination:service=Queue,name=A
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq.destination:service=Queue,name=B
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq.destination:service=Queue,name=C
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq.destination:service=Queue,name=D
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq.destination:service=Queue,name=ex
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
|
| ObjectName: jboss.mq:service=Invoker
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=TracingInterceptor
| jboss:service=Naming
| Depends On Me:
| jboss.mq:service=InvocationLayer,type=HTTP
| jboss.mq:service=InvocationLayer,type=JVM
| jboss.mq:service=InvocationLayer,type=UIL2
|
| ObjectName: jboss.mq:service=TracingInterceptor
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=SecurityManager
| Depends On Me:
| jboss.mq:service=Invoker
|
| ObjectName: jboss.mq:service=SecurityManager
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
| Depends On Me:
| jboss.mq.destination:service=Topic,name=testTopic
| jboss.mq.destination:service=Topic,name=securedTopic
| jboss.mq.destination:service=Topic,name=testDurableTopic
| jboss.mq.destination:service=Queue,name=testQueue
| jboss.mq:service=TracingInterceptor
| jboss.mq.destination:service=Queue,name=DLQ
|
| ObjectName: jboss.mq.destination:service=Queue,name=DLQ
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=DestinationManager
| jboss.mq:service=SecurityManager
|
| ObjectName: jboss.mq:service=InvocationLayer,type=JVM
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=Invoker
|
| ObjectName: jboss.mq:service=InvocationLayer,type=UIL2
| State: CONFIGURED
| I Depend On:
| jboss.mq:service=Invoker
|
| ObjectName: jboss.j2ee:service=EJB3,module=AVmanBean.jar
| State: FAILED
| Reason: java.lang.IllegalStateException: Container jboss.j2ee:jar=AVmanBean.jar,name=AVmanBean,service=EJB3 + is already registered
|
| --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
| ObjectName: jboss.jca:service=DataSourceBinding,name=OracleDS
| State: NOTYETINSTALLED
| Depends On Me:
| jboss:service=juddi
| jboss.mq:service=StateManager
| jboss.mq:service=PersistenceManager
|
| ObjectName: jboss.j2ee:service=EJB3,module=AVmanBean.jar
| State: FAILED
| Reason: java.lang.IllegalStateException: Container jboss.j2ee:jar=AVmanBean.jar,name=AVmanBean,service=EJB3 + is already registered
|
|
| 13:29:54,796 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 13:29:54,812 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 13:29:54,828 INFO [Server] JBoss (MX MicroKernel) [4.2.1.GA (build: SVNTag=JBoss_4_2_1_GA date=200707131605)] Started in 26s:922ms
| 13:31:04,812 WARN [Ejb3Module] Destroying failed jboss.j2ee:service=EJB3,module=AVmanBean.jar
| java.lang.IllegalStateException: Container jboss.j2ee:jar=AVmanBean.jar,name=AVmanBean,service=EJB3 + is not registered
| at org.jboss.ejb3.Ejb3Registry.unregister(Ejb3Registry.java:94)
| at org.jboss.ejb3.Ejb3Deployment.undeploy(Ejb3Deployment.java:686)
| at org.jboss.ejb3.Ejb3Deployment.destroy(Ejb3Deployment.java:675)
| at org.jboss.ejb3.Ejb3Module.destroyService(Ejb3Module.java:122)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalDestroy(ServiceMBeanSupport.java:345)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:249)
| at sun.reflect.GeneratedMethodAccessor3.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.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.destroy(Unknown Source)
| at org.jboss.system.ServiceController.destroy(ServiceController.java:577)
| 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 $Proxy33.destroy(Unknown Source)
| at org.jboss.ejb3.EJB3Deployer.destroy(EJB3Deployer.java:550)
| 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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.destroy(DeployerInterceptor.java:109)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.destroy(SubDeployerInterceptorSupport.java:204)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:103)
| 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 $Proxy34.destroy(Unknown Source)
| at org.jboss.deployment.MainDeployer.destroy(MainDeployer.java:704)
| at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:639)
| at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:632)
| at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:615)
| 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 $Proxy9.undeploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.undeploy(URLDeploymentScanner.java:450)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:570)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
|
|
it says its deplyed, then it says it isnt, then it says it cant destroy it. i've been clearing my temp files and redeploying and keep getting back here. and when i try access the web service, it says;
javax.xml.ws.WebServiceException: Cannot find service endpoint target: jboss.j2ee:name=AVmanBean,service=EJB3,jar=AVmanBean.jar
hugely grateful for any help!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098805#4098805
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098805
18Â years, 6Â months
[JBoss Seam] - Security questions to the Seam team
by ylazzari
Hi,
I have 2 questions about the authentication process.
#1
Would you agree if I opened a JIRA issue to change the SeamLoginModule class to properly chain exceptions when throwing LoginExceptions in the login method? See code below:
| public boolean login()
| throws LoginException
| {
| try
| {
| NameCallback cbName = new NameCallback("Enter username");
| PasswordCallback cbPassword = new PasswordCallback("Enter password", false);
|
| // Get the username and password from the callback handler
| callbackHandler.handle(new Callback[] { cbName, cbPassword });
| username = cbName.getName();
| }
| catch (Exception ex)
| {
| log.error("Error logging in", ex);
| throw new LoginException(ex.getMessage());
| }
|
| MethodExpression mb = Identity.instance().getAuthenticateMethod();
| if (mb==null)
| {
| throw new IllegalStateException("No authentication method defined - please define <security:authenticate-method/> for <security:identity/> in components.xml");
| }
|
| try
| {
| return (Boolean) mb.invoke();
| }
| catch (Exception ex)
| {
| log.error("Error invoking login method", ex);
| throw new LoginException(ex.getMessage());
| }
| }
|
In both instances where a LoginException is thrown, only the message is passed to the constructor of the LoginException. I know that the LoginException does not overload the constructor to pass a cause directly but we can use the initCause method instead:
| LoginException loginException = new LoginException();
| loginException.initCause(originalException);
| throw loginException;
|
If people use typed exceptions in their authenticator method to express different reasons why the login attempt failed, it's impossible right now to get that original exception.
#2
The default behaviour of the isLoggedIn method in the Identity class is to pass the attemptLogin flag to true. Because of that, when authentication fails, it always calls the authenticator method twice. See the code of the authenticate() method below:
| public void authenticate()
| throws LoginException
| {
| // If we're already authenticated, then don't authenticate again
| if (!isLoggedIn())
| {
| authenticate( getLoginContext() );
| }
| }
|
|
| public boolean isLoggedIn(boolean attemptLogin)
| {
| if (!authenticating && attemptLogin && getPrincipal() == null && isCredentialsSet() &&
| Contexts.isEventContextActive() &&
| !Contexts.getEventContext().isSet(LOGIN_TRIED))
| {
| Contexts.getEventContext().set(LOGIN_TRIED, true);
| quietLogin();
| }
|
| // If there is a principal set, then the user is logged in.
| return getPrincipal() != null;
| }
|
| public void authenticate(LoginContext loginContext)
| throws LoginException
| {
| try
| {
| authenticating = true;
| preAuthenticate();
| loginContext.login();
| postAuthenticate();
| }
| finally
| {
| authenticating = false;
| }
| }
|
The first reference to isLoggedIn tries to log the user. When it fails, it goes in the if block and tries to authenticate the user for a second time before failing again. I could fix this on my end by overriding the isLoggedIn() method in my own Identity component and passing the attemptLogin flag to false. Before doing so, I thought that perhaps a fix could be done at a higher level, i.e. in the Identity class of Seam itself. The way I see it, 2 things could be done:
1. In the authenticate() method, invoke the isLoggedIn method with false.
2. Look into the management of the authenticating class member; there might be something wrong. It's only set to true at the beginning of the authenticate(LoginContext) method. If you look at the logic in the isLoggedIn(boolean) method, when it winds up being invoked at the beginning of the authenticate(), the authenticating flag is false, the attemptLogin flag is true, I don't have a principal yet (I'm trying to login for the first time) and my credentials are set (the user just provided his username and password).
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098803#4098803
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098803
18Â years, 6Â months