[JBoss Portal] - error changing theme when logged in as admin in 2.6cr2
by glarenzie
The following error displays in the log when trying to change the theme in the admin module for the default portal. A javascript error also gets thrown. you can change from renaissence to maple in the combo box but it comes back renaissence.
Windows XP
MS SQL 2000
base portal no changes.
14:07:29,307 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jstl-fn.ta
glib.xml
14:07:29,338 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jsf-html.t
aglib.xml
14:07:29,354 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28823portal-faces-lib.jar!/META-INF/portal.taglib.xml
14:07:29,401 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jsf-ui.tag
lib.xml
14:07:29,416 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28821jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
14:07:29,416 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28821jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
14:07:29,479 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jstl-core.
taglib.xml
14:07:29,557 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28821jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
14:07:29,557 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28821jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
14:07:29,573 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28821jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
14:07:29,573 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
LibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jsf-core.t
aglib.xml
14:07:30,354 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, De
tectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044011#4044011
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044011
19 years
[JBossWS] - Re: JBossWS 1.2 on JBoss AS 4.0.5
by tcavaleiro
Hi!
I've installed JBossWS 1.2 on JBoss AS 4.0.5 (with EJB 3.0)
and I'm getting that error too.
Maybe I'm asking about ordinary things but I'm just a beginner (in this world)...by the way I've already made a few things with JBoss Seam (it's great).
I'm gonna post all the output I get from JBoss..
| ===============================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: C:\Programas\jboss-4.0.5.GA\bin\\..
|
| JAVA: c:\Programas\Java\jdk1.5.0_09\bin\java
|
| JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=36000
| 00
|
| CLASSPATH: c:\Programas\Java\jdk1.5.0_09\lib\tools.jar;C:\Programas\jboss-4.0.5.GA\bin\\run.jar
|
| ===============================================================================
|
| 18:56:26,078 INFO [Server] Starting JBoss (MX MicroKernel)...
| 18:56:26,078 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
| 18:56:26,078 INFO [Server] Home Dir: C:\Programas\jboss-4.0.5.GA
| 18:56:26,078 INFO [Server] Home URL: file:/C:/Programas/jboss-4.0.5.GA/
| 18:56:26,078 INFO [Server] Patch URL: null
| 18:56:26,078 INFO [Server] Server Name: default
| 18:56:26,078 INFO [Server] Server Home Dir: C:\Programas\jboss-4.0.5.GA\server\default
| 18:56:26,078 INFO [Server] Server Home URL: file:/C:/Programas/jboss-4.0.5.GA/server/default/
| 18:56:26,078 INFO [Server] Server Log Dir: C:\Programas\jboss-4.0.5.GA\server\default\log
| 18:56:26,078 INFO [Server] Server Temp Dir: C:\Programas\jboss-4.0.5.GA\server\default\tmp
| 18:56:26,078 INFO [Server] Root Deployment Filename: jboss-service.xml
| 18:56:26,343 INFO [ServerInfo] Java version: 1.5.0_09,Sun Microsystems Inc.
| 18:56:26,343 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_09-b01,Sun Microsystems Inc.
| 18:56:26,343 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
| 18:56:26,906 INFO [Server] Core system initialized
| 18:56:28,734 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
| 18:56:30,484 INFO [SocketServerInvoker] Invoker started for locator: InvokerLocator [socket://10.64.139.35:3873/]
| 18:56:33,140 INFO [ServiceEndpointManager] jbossws-1.2.1.GA (build=200704161533)
| 18:56:38,437 ERROR [JUDDIService] JNDI Bind Failed:JAXR
| 18:56:38,437 ERROR [STDERR] javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Recei
| ve timed out]
| 18:56:38,437 ERROR [STDERR] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1317)
| 18:56:38,437 ERROR [STDERR] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1446)
| 18:56:38,437 ERROR [STDERR] at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:484)
| 18:56:38,437 ERROR [STDERR] at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:477)
| 18:56:38,437 ERROR [STDERR] at javax.naming.InitialContext.rebind(InitialContext.java:367)
| 18:56:38,437 ERROR [STDERR] at org.jboss.jaxr.juddi.JUDDIService.bindJAXRConnectionFactory(JUDDIService.java:383)
| 18:56:38,437 ERROR [STDERR] at org.jboss.jaxr.juddi.JUDDIService.setBindJaxr(JUDDIService.java:320)
| 18:56:38,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 18:56:38,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 18:56:38,437 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 18:56:38,437 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:136)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:103)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:76)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:461)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)
| 18:56:38,437 ERROR [STDERR] at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:694)
| 18:56:38,437 ERROR [STDERR] at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:332)
| 18:56:38,437 ERROR [STDERR] at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
| 18:56:38,437 ERROR [STDERR] at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| 18:56:38,437 ERROR [STDERR] at org.jboss.system.ServiceController.install(ServiceController.java:226)
| 18:56:38,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 18:56:38,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 18:56:38,437 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 18:56:38,437 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 18:56:38,437 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| 18:56:38,437 ERROR [STDERR] at $Proxy4.install(Unknown Source)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 18:56:38,453 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| 18:56:38,453 ERROR [STDERR] at $Proxy6.deploy(Unknown Source)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.jav
| a:263)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| 18:56:38,453 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| 18:56:38,453 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 18:56:38,453 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 18:56:38,453 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| 18:56:38,453 ERROR [STDERR] at $Proxy0.start(Unknown Source)
| 18:56:38,453 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 18:56:38,453 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| 18:56:38,453 ERROR [STDERR] at $Proxy4.start(Unknown Source)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| 18:56:38,453 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 18:56:38,453 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 18:56:38,453 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 18:56:38,453 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| 18:56:38,453 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
| 18:56:38,453 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| 18:56:38,453 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| 18:56:38,453 ERROR [STDERR] at org.jboss.Main.boot(Main.java:200)
| 18:56:38,453 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:490)
| 18:56:38,453 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 18:56:38,453 ERROR [STDERR] Caused by: java.net.SocketTimeoutException: Receive timed out
| 18:56:38,453 ERROR [STDERR] at java.net.PlainDatagramSocketImpl.receive0(Native Method)
| 18:56:38,453 ERROR [STDERR] at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
| 18:56:38,453 ERROR [STDERR] at java.net.DatagramSocket.receive(DatagramSocket.java:712)
| 18:56:38,453 ERROR [STDERR] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1287)
| 18:56:38,453 ERROR [STDERR] ... 105 more
| 18:56:39,562 INFO [SnmpAgentService] SNMP agent going active
| 18:56:39,921 INFO [WebService] Using RMI server codebase: http://PORTABLE:8083/
|
| (other things...)
|
|
By the way, anyone solved the problem?
Thanks for the help!
Tiago.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044009#4044009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044009
19 years
[JBoss Seam] - Seam 1.2.1.GA Integration Testing (identity.login)
by mhaubrich
Hi,
I have a question about the integration testing of the login process with the 1.2.1 seam version and I hope someone can help me here as I've been trying around for quite some time now on my own to no result...
Ok... I have the following JSF view: (extract)
<h:form rendered="#{not identity.loggedIn}">
| #{messages['login.form']}
| <br />
|
| <span class="errors">
| <h:messages globalOnly="true" />
| </span>
|
| <table cellspacing="2" cellpadding="2" border="0" >
| <tr>
| <td>#{messages['login.login']}:</td><td><h:inputText value="#{identity.username}" id="login" /></td>
| </tr>
| <tr>
| <td>#{messages['login.pwd']}:</td><td><h:inputSecret value="#{identity.password}" id="password" /></td>
| </tr>
| <tr>
| <td colspan="2" align="right"><h:commandButton value="#{messages['login.button']}" action="#{identity.login}" /></td>
| </tr>
| </table>
| </h:form>
In components.xml I have defined my authentication method as follows:
<security:identity authenticate-method="#{authenticator.authenticate}"/>
|
My Authenticator interface and AuthenticatorAction class look like so:
import org.jboss.annotation.ejb.Local;
|
| @Local
| public interface Authenticator {
|
| public boolean authenticate();
|
| }
| import java.io.Serializable;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.JndiName;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.contexts.Context;
| import org.jboss.seam.log.Log;
| import org.jboss.seam.security.Identity;
|
| @Name("authenticator")
| public class AuthenticatorAction implements Authenticator, Serializable
| {
| private static final long serialVersionUID = 4836686434984261542L;
|
| private static final String USER_VAR = "currentUser";
|
| @In
| private Context sessionContext;
|
| @Logger
| private Log log;
|
|
| /**
| * validate the username and password
| */
| public boolean authenticate()
| {
|
| User user = ServiceLocator.instance() // find user in database
| .getLoginService()
| .authenticate(Identity.instance().getUsername(), Identity.instance().getPassword());
| if(user==null)
| {
| log.debug("invalid login!");
| return false;
| }
|
| Identity.instance().addRole("user");
|
| if(user.isAdmin()) // add admin role if the user is an admin
| Identity.instance().addRole("admin");
|
| sessionContext.set(USER_VAR, user); // save in session context
|
| log.debug("login successful: #0", user);
|
| return true;
| }
|
|
| }
And finally my test class:
| import static org.testng.AssertJUnit.*;
|
| import org.jboss.seam.log.Log;
| import org.jboss.seam.log.Logging;
| import org.jboss.seam.mock.SeamTest;
| import org.testng.annotations.Configuration;
| import org.testng.annotations.Test;
|
| public class AuthenticatorActionTest extends SeamTest {
|
|
| @Test
| public void testAuthenticate() throws Exception
| {
|
| new FacesRequest()
| {
|
| @Override
| protected void updateModelValues() throws Exception
| {
| assertFalse("session should be valid", isSessionInvalid()); // assert that the session is NOT invalid
|
| setValue("#{identity.username}", "test"); // inject the login values
| setValue("#{identity.password}", "test");
|
| }
|
| @Override
| protected void invokeApplication()
| {
| invokeMethod("#{identity.login}");
| }
|
| @Override
| protected void renderResponse()
| {
|
| assertTrue("identity.loggedIn", getValue("#{identity.loggedIn}").equals(true)); // make sure that we are logged in
| assertEquals("view id", "/home.xhtml", getViewId() ); // assert that the home-page is being shown
| }
|
| }.run();
|
|
| }
| }
Now when I run the Test it fails at the assertTrue("identity.loggedIn", getValue("#{identity.loggedIn}").equals(true)); part !
Am I missing something here ?!
Thanks for you help !
Maarten
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044007#4044007
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044007
19 years