[EJB 3.0] - javax.ejb.EJBAccessException: Authentication failure
by pipothebit
Hi,
I have a simple Stateless Session Bean and a standalone client to invoke the Session Bean.
The code:
...
@Stateless
@SecurityDomain("xifra")
public class RolService implements IRolServiceLocal, IRolServiceRemote {
@PersistenceContext(unitName = "xifra")
private EntityManager em;
public Rol merge(Rol rol) throws Exception {
return em.merge(rol);
}
...
Client code:
...
Properties properties = new Properties();
properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
properties.put("java.naming.provider.url", "jnp://localhost:1099");
properties.put("jnp.disableDiscovery", "true");
properties.put(InitialContext.SECURITY_PRINCIPAL, "system");
properties.put(InitialContext.SECURITY_CREDENTIALS, "system");
InitialContext initialContext = new InitialContext(properties);
IRolServiceRemote iRolServiceRemote = (IRolServiceRemote) initialContext().lookup("xifra/RolService/remote");
Rol rol = new Rol("ADMIN");
rol = iRolServiceRemote.merge(rol);
...
When I invoque the merge call to stateless session bean i get a javax.ejb.EJBAccessException: Authentication failure.
My login-config.xml look like:
...
<application-policy name="xifra">
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name="dsJndiName">java:/jdbc/xifra</module-option>
<module-option name="principalsQuery">select passwd from usuario where usernme = ?</module-option>
<module-option name="rolesQuery">select codigo, 'Roles' from rol left join usuario_rol on rol.id = usuario_rol.rol_id left join usuario on usuario_rol.usuario_id = usuario.id where usuario.usernme = ?</module-option>
<module-option name="debug">true</module-option>
</login-module>
</application-policy>
...
I got messages explaining that principal is null so I extended DatabaseServerLoginModule to see what username and password uses to authenticate and it's true, username and password are null.
Can someone help me?
Very thank you.V
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978413#3978413
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978413
19 years, 8 months
[JBoss Seam] - Seam woes
by MIC331
I have a problem where pressing the commandButton simply refreshes the page and does not invoke the action. I have seen the reference to this problem in the Seam FAQ. I have checked the suggestions with no luck. The strange thing is that this was working for me. The problem appeared, it seems, after I added Tomahawk support. Even after removing the references to Tomahawk the problem persists. I have verfified that Seam finds the component constructor. Subsequent action calls do nothing though. Below is the log trace. I continue to receive the warning about the Trinidad filter not installed although the web.xml has a reference to it.
anonymous wrote : 2006-10-15 16:28:02,421 ERROR [STDERR] Oct 15, 2006 4:28:02 PM org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl verifyFilterIsInstalled
| WARNING: The TrinidadFilter has not been installed. Apache Trinidad requires this filter for proper execution.
| 2006-10-15 16:28:02,421 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin web request
| 2006-10-15 16:28:02,421 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager
| 2006-10-15 16:28:02,421 DEBUG [org.jboss.seam.core.Manager] No stored conversation
| 2006-10-15 16:28:02,421 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init
| 2006-10-15 16:28:02,421 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(30)
| 2006-10-15 16:28:02,421 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: LoginAction
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: LoginAction
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: LoginAction
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: LoginAction
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: LoginAction
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: LoginAction
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.trinidadinternal.context.PageFlowScope
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.trinidadinternal.share.Cookie
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.trinidadinternal.context.CachedRequestContext
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.trinidadinternal.InitialViewRoot
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: jsf_sequence
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.trinidadinternal.context.AdfFacesPhaseListener.POSTBACK
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.trinidadinternal.context.AdfFacesPhaseListener.CREATED_CONTEXT
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
| 2006-10-15 16:28:02,437 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
|
I am using myfaces 1.1.5 with seam implementation of 18/06/06 and trinidad.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978406#3978406
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978406
19 years, 8 months
[EJB 3.0] - Re: java.lang.RuntimeException: org.jboss.tm.JBossRollbackE
by awclemen
Hello again,
It seems to have something to do with passing the object. If I pass null as shown below, I get no error:
| int returnValue = ua.scheduleFlight(passengerFlightInfoId,null);
|
OK, so what is wrong with the object? Here it is:
|
| package com.clementsengineering.persistence;
|
| import javax.persistence.*;
|
| @Entity
| @Table(name="XXX_users")
| public class Users implements java.io.Serializable {
|
| private int user_id;
| private String user_login;
| private String user_email;
| private String user_first_name;
| private String user_last_name;
| private int role_number;
|
| @Id
| @GeneratedValue
| @Column(name="user_id")
| public int getUserId() { return user_id; }
|
| public void setUserId(int anUserId) { this.user_id = anUserId; }
|
| @Column(name="user_login")
| public String getUserLogin() { return user_login; }
|
| public void setUserLogin(String anUserLogin) { this.user_login = anUserLogin; }
|
| @Column(name="user_email")
| public String getUserEmail() { return user_email; }
|
| public void setUserEmail(String anUserEmail) { this.user_email = anUserEmail; }
|
| @Column(name="user_first_name")
| public String getUserFirstName() { return user_first_name; }
|
| public void setUserFirstName(String anUserFirstName) { this.user_first_name = anUserFirstName; }
|
| @Column(name="user_last_name")
| public String getUserLastName() { return user_last_name; }
|
| public void setUserLastName(String anUserLastName) { this.user_last_name = anUserLastName; }
|
| @Column(name="role_number")
| public int getRoleNumber() { return role_number; }
|
| public void setRoleNumber(int aRoleNumber) { this.role_number = aRoleNumber; }
|
| } // end class Users
|
|
I pass other similar EJB3 persistence objects in other servlets with no problem, so what is happening here?
Thanks in advance!
Andy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978405#3978405
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978405
19 years, 8 months
[JBoss Messaging] - Messaging will not restart
by jaap
Hi,
When i restart JBossAS, Messaging fails to come back online. When first installed it worked fine. But a restart of JBossAS killed Messaging unfortunately. I use MySQL datasource. Kind of a standard setup ds-xml. I removed all tables that are created by Messaging. It recreates them but still these errors.
JBoss Messaging has a dedicated DataSource (of course), and i am using the GA version i downloaded yesterday.
2006-10-15 17:36:55,406 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager]
JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently REPEATABLE_READ.
Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
2006-10-15 17:36:56,625 WARN [org.jboss.resource.connectionmanager.TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@71dfd7[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@1e384de handles=1 lastUse=1160926616546 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@280bca context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@11dfada xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@14021a9 txSync=null]
java.sql.SQLException: No operations allowed after statement closed.
at com.mysql.jdbc.Statement.checkClosed(Statement.java:274)
at com.mysql.jdbc.ServerPreparedStatement.checkClosed(ServerPreparedStatement.java:411)
at com.mysql.jdbc.ServerPreparedStatement.clearParameters(ServerPreparedStatement.java:418)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:4327)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:349)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:344)
at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:187)
at org.jboss.messaging.core.plugin.JDBCPersistenceManager.reserveIDBlock(JDBCPersistenceManager.java:368)
at org.jboss.messaging.core.plugin.IdManager.getNextBigBlock(IdManager.java:96)
at org.jboss.messaging.core.plugin.IdManager.(IdManager.java:60)
at org.jboss.messaging.core.tx.TransactionRepository.start(TransactionRepository.java:78)
at org.jboss.jms.server.ServerPeer.startService(ServerPeer.java:213)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at sun.reflect.GeneratedMethodAccessor9.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 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 $Proxy40.start(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
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 sun.reflect.GeneratedMethodAccessor64.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 $Proxy8.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.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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.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: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)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978402#3978402
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978402
19 years, 8 months