Skip to main content

JDBCRealm Problem

1 reply [Last post]
reos
Offline
Joined: 2005-06-28
Points: 0

I've a problem when I try to login in the application.

This is my Realm configuration

JAAS Context:  jdbcRealm
JNDI:  jdbc/acDS
User Table:  USUARIOS
User Name Column:  NOMBRE_USUARIOS
Password Column:  CLAVE
Group Table:  V_PERFILES_USUARIO
Group Table User Name Column:
Group Name Column:  NOMBRE
Assign Groups:
Database User:
Database Password:
Digest Algorithm: SHA-256
Password Encryption Algorithm:
Encoding: Base64
Charset: ISO-8859-2

For the password I use the next code. I copied the value from the console and then inserted manually in the database. The database characterset is Latin2. It's the same as "ISO-8859-2".

MessageDigest messageDigest = java.security.MessageDigest .getInstance("SHA-256");
byte bin = messageDigest.digest(("adminadmin").getBytes("ISO-8859-2"));
System.out.println(Base64.encodeBase64String(bin));

I'm login inside a jsf managedbean

FacesContext contexto = FacesContext.getCurrentInstance();
HttpServletRequest peticion = (HttpServletRequest) contexto
.getExternalContext().getRequest();

peticion.login(nombreUsuario, clave);

But when I try to login the next error appear. I don´t know why it appears. The stacktrace doesn´t tellme anything about the error.

[#|2012-10-24T14:39:52.826-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;|javax.servlet.ServletException: Exception thrown while attempting to authenticate for user: roramas
at org.apache.catalina.connector.Request.login(Request.java:1970)
at org.apache.catalina.connector.Request.login(Request.java:1901)
at org.apache.catalina.connector.RequestFacade.login(RequestFacade.java:1146)
at com.oramas.rommel.tesis.ac.web.beans.IngresoSistemaBean.ingresarAlSistema(IngresoSistemaBean.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.servlet.ServletException: Failed login while attempting to authenticate user: roramas
at org.apache.catalina.connector.Request.login(Request.java:1941)
... 43 more
|#]

[#|2012-10-24T14:39:52.827-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.connector.Request.login(Request.java:1970)|#]

[#|2012-10-24T14:39:52.827-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.connector.Request.login(Request.java:1901)|#]

[#|2012-10-24T14:39:52.831-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.connector.RequestFacade.login(RequestFacade.java:1146)|#]

[#|2012-10-24T14:39:52.834-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.oramas.rommel.tesis.ac.web.beans.IngresoSistemaBean.ingresarAlSistema(IngresoSistemaBean.java:31)|#]

[#|2012-10-24T14:39:52.834-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|#]

[#|2012-10-24T14:39:52.834-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)|#]

[#|2012-10-24T14:39:52.835-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|#]

[#|2012-10-24T14:39:52.835-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at java.lang.reflect.Method.invoke(Method.java:601)|#]

[#|2012-10-24T14:39:52.836-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.el.parser.AstValue.invoke(AstValue.java:254)|#]

[#|2012-10-24T14:39:52.837-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)|#]

[#|2012-10-24T14:39:52.837-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)|#]

[#|2012-10-24T14:39:52.838-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)|#]

[#|2012-10-24T14:39:52.838-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)|#]

[#|2012-10-24T14:39:52.839-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at javax.faces.component.UICommand.broadcast(UICommand.java:315)|#]

[#|2012-10-24T14:39:52.839-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)|#]

[#|2012-10-24T14:39:52.841-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)|#]

[#|2012-10-24T14:39:52.841-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)|#]

[#|2012-10-24T14:39:52.841-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)|#]

[#|2012-10-24T14:39:52.842-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)|#]

[#|2012-10-24T14:39:52.842-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)|#]

[#|2012-10-24T14:39:52.842-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)|#]

[#|2012-10-24T14:39:52.848-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)|#]

[#|2012-10-24T14:39:52.848-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)|#]

[#|2012-10-24T14:39:52.849-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)|#]

[#|2012-10-24T14:39:52.849-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)|#]

[#|2012-10-24T14:39:52.849-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)|#]

[#|2012-10-24T14:39:52.849-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)|#]

[#|2012-10-24T14:39:52.849-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)|#]

[#|2012-10-24T14:39:52.850-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)|#]

[#|2012-10-24T14:39:52.850-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)|#]

[#|2012-10-24T14:39:52.850-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)|#]

[#|2012-10-24T14:39:52.850-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)|#]

[#|2012-10-24T14:39:52.850-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)|#]

[#|2012-10-24T14:39:52.850-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)|#]

[#|2012-10-24T14:39:52.851-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)|#]

[#|2012-10-24T14:39:52.851-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)|#]

[#|2012-10-24T14:39:52.851-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)|#]

[#|2012-10-24T14:39:52.851-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)|#]

[#|2012-10-24T14:39:52.857-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)|#]

[#|2012-10-24T14:39:52.857-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)|#]

[#|2012-10-24T14:39:52.857-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.ContextTask.run(ContextTask.java:71)|#]

[#|2012-10-24T14:39:52.857-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)|#]

[#|2012-10-24T14:39:52.858-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)|#]

[#|2012-10-24T14:39:52.858-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at java.lang.Thread.run(Thread.java:722)|#]

[#|2012-10-24T14:39:52.858-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;|Caused by: javax.servlet.ServletException: Failed login while attempting to authenticate user: roramas|#]

[#|2012-10-24T14:39:52.858-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| at org.apache.catalina.connector.Request.login(Request.java:1941)|#]

[#|2012-10-24T14:39:52.859-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=71;_ThreadName=Thread-2;| ... 43 more|#]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
reos
Offline
Joined: 2005-06-28
Points: 0

Problem solved. The application server needed a restart.