[EJB 3.0] - Re: server-side exceptions in EJB3
by bluesterror
anonymous wrote : Please post that exception stacktrace. What is your client? Is it a standalone application or something else?
The client is a Swing application that uses remote SLSBs. Here's the client-side stack trace from throwing an IllegalArgumentException in our login routine. Again, nothing is logged on the server.
| Thread-1 - jdis.client.core.ErrorHandler[29 Jul 2008 10:03:34,832]: ERROR - Thread[Thread-1,5,main]
| javax.security.auth.login.LoginException: javax.ejb.EJBException: java.lang.IllegalArgumentException: Do I get logged?
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
| at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| Caused by: java.lang.IllegalArgumentException: Do I get logged?
| at jdis.server.session.login.LoginSessionBean.login(LoginSessionBean.java:69)
| 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:597)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
| at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.login(Unknown Source)
| at jdis.client.manager.LoginManager.login(LoginManager.java:53)
| at jdis.client.login.ClientLoginModule.doLogin(ClientLoginModule.java:215)
| at jdis.client.login.ClientLoginModule.login(ClientLoginModule.java:153)
| 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:597)
| at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
| at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
| at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
| at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
| at jdis.client.login.LoginOperation.login(LoginOperation.java:45)
| at jdis.client.Main.authenticateAndStart(Main.java:326)
| at jdis.client.Main$1.run(Main.java:170)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.login(Unknown Source)
| at jdis.client.manager.LoginManager.login(LoginManager.java:53)
| at jdis.client.login.ClientLoginModule.doLogin(ClientLoginModule.java:215)
| at jdis.client.login.ClientLoginModule.login(ClientLoginModule.java:153)
| 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:597)
| at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
| at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
| at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
| at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
| at jdis.client.login.LoginOperation.login(LoginOperation.java:45)
| at jdis.client.Main.authenticateAndStart(Main.java:326)
| at jdis.client.Main$1.run(Main.java:170)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167347#4167347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167347
16 years, 5 months
[Security & JAAS/JBoss] - NullPointerException in getCallerPrincipal()
by johanmicoud
I have upgraded to JBoss 5.0.0 CR1.
Client side, my authentification uses JndiLoginContextFactory with
env.put(Context.SECURITY_PRINCIPAL,"user");
env.put(Context.SECURITY_CREDENTIALS, "password");
Server side, every call to getCallerPrincipal() raises a NullPointerException in EJBContextHelper (!!).
Here is the stack trace :
javax.ejb.EJBException: java.lang.NullPointerException
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:67)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:157)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:390)
at org.jboss.ejb3.session.ClassProxyHack._dynamicInvoke(ClassProxyHack.java:52)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:847)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:681)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:634)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:459)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:197)
Caused by: java.lang.NullPointerException
at org.jboss.ejb3.security.helpers.EJBContextHelper.getCallerPrincipal(EJBContextHelper.java:91)
at org.jboss.ejb3.EJBContextImpl.getCallerPrincipal(EJBContextImpl.java:138)
at fr.aeag.redevances.services.dossier.impl.DossierServiceImpl.findByCriteria(DossierServiceImpl.java:300)
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:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
at fr.aeag.commons.profiling.ProfilingInterceptor.profile(ProfilingInterceptor.java:28)
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:597)
Any idea ? This problem is very annoying ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167341#4167341
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167341
16 years, 5 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: OpenJPA and JBoss
by hungtru
Hi there.
The strange thing is that I don't really have exceptions.
I'm using JBoss 4.2.2, OpenJPA 1.1.0, and Java 1.5.
In two beans, I am injecting the OpenJPA context via the @PersistenceContext(unitName="EventData")
But I never see these two beans deploy completely, as it says it is waiting for the persistence unit "EventData" to start.
My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="EventData" transaction-type="JTA">
org.apache.openjpa.persistence.PersistenceProviderImpl
<jta-data-source>java:jdbc/ds</jta-data-source>
I have classes here
</persistence-unit>
I get the following in the JBoss server log:
2008-07-29 00:32:07,373 DEBUG [org.jboss.ejb3.Ejb3Module] Starting jboss.j2ee:service=EJB3,module=app_ejb-1.0.0.jar
2008-07-29 00:32:07,394 DEBUG [org.jboss.injection.PersistenceUnitHandler] ******* could not find PU dependency so adding a default: persistence.units:unitName=EventData
2008-07-29 00:32:07,402 DEBUG [org.jboss.ejb3.EJBContainer] Initialising interceptors for DataAccessBean...
2008-07-29 00:32:07,402 DEBUG [org.jboss.ejb3.EJBContainer] Default interceptors: null
2008-07-29 00:32:07,402 DEBUG [org.jboss.ejb3.EJBContainer] Class interceptors: []
2008-07-29 00:32:07,403 DEBUG [org.jboss.ejb3.EJBContainer] All applicable interceptor classes: []
...
2008-07-29 00:32:07,442 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3 with dependencies:
2008-07-29 00:32:07,442 INFO [org.jboss.ejb3.JmxKernelAbstraction] persistence.units:unitName=EventData
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] adding depenApp in ServiceController.register: [persistence.units:unitName=EventData]
...
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3 waiting on persistence.units:unitName=EventData
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3
It never hits the
2008-07-29 00:32:07,450 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB:
Like all my other session beans do.
Does that mean that the bean is still waiting for the persistence unit? These are the only two that don't get deployed completely and available in JNDI and the only ones that use the persistence stuff.
Sometimes...and not always, i will get trace logs from OpenJPA:
70 EventData INFO [pool-13-thread-1] openjpa.Runtime - Starting OpenJPA 1.1.0
71 EventData TRACE [pool-13-thread-1] openjpa.Runtime - Properties: openjpa.EntityManagerFactory: default
99 EventData TRACE [pool-13-thread-1] openjpa.Runtime - No cache marshaller found for id org.apache.openjpa.conf.MetaDataCacheMaintenance.
195 EventData TRACE [pool-13-thread-1] openjpa.MetaData - Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@3a3b6b".
206 EventData TRACE [pool-13-thread-1] openjpa.jdbc.JDBC - OpenJPA will now connect to the database to attempt to determine what type of database dictionary to use. You may prevent this connection in the future by setting your openjpa.jdbc.DBDictionary configuration property to the appropriate value for your database (see the documentation for available values).
Not that I don't always get the openjpa.log, I don't know why though...it is rather inconsistent.
Thanks for any help.
H
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167331#4167331
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167331
16 years, 5 months