[JBoss Seam] - Does #{identity.login} start a long running conversation?
by schmatz
Hello guys,
I'm a bit confused. Does #{identity.login} start a long running conversation? I'm just asking because after successfully logging in, my User entity bean which I have outjected in the Authenticator.authenticate() method and injected in my conversational-scoped Stateful EJB still lives after every other click.
I have no @Begin/@End annotations declared myself.
Here's the beginning of my EJB:
@Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("userAction")
| public class UserActionImpl implements UserAction
| {
| @Logger private Log log;
|
| @In
| FacesMessages facesMessages;
|
| @In(value="entityManager")
| private EntityManager em;
|
| @In(required=false) @Out(required=false)
| private User user;
|
| [...]
And here's my Authenticator class:
@Name("authenticator")
| public class Authenticator
| {
| @Logger Log log;
|
| @In
| private Identity identity;
|
| @In(value="entityManager")
| private EntityManager entityManager;
|
| @Out(required=false)
| private User user;
|
| public boolean authenticate()
| {
| log.info("authenticating #0", identity.getUsername());
|
| //write your authentication logic here,
| //return true if the authentication was
| //successful, false otherwise
|
| try
| {
| user = (User) entityManager.createQuery(
| "from User where username = :username and password = :password")
| .setParameter("username", identity.getUsername())
| .setParameter("password", identity.getPassword())
| .getSingleResult();
|
| if( user.getRoles() != null )
| {
| for( Role role : user.getRoles() )
| identity.addRole(role.getName());
| }
|
| //FacesMessages.instance().add("Successfully authenticated #0", identity.getUsername());
| log.info("Successfully authenticated #0", identity.getUsername());
| return true;
| }
| catch( NoResultException e )
| {
| //FacesMessages.instance().add("Invalid username/password");
| log.info("authentication of #0 failed.", identity.getUsername());
| return false;
| }
| catch( Exception e )
| {
| FacesMessages.instance().add("Unexpected error occurred.");
| log.error("Unexpected error occurred", e);
| return false;
| }
| }
| }
Like you can see: it's just out- and injecting the User which I expect to live for only one cycle (when no long running conversation exists). But I can click on my 'show-user-details' form as many times as I want and - magic - every other time the user's properties are displayed. Don't misunderstand me, this is exactly the behaviour I want but I thought I would have to start a long running conversation manually.
Can someone explain that 'magic' to me?
Thanks i.a.,
Mark
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021943#4021943
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021943
19Â years, 2Â months
[JBoss jBPM] - Re: deployment problem
by abdenourh
Sorry I mean when I try to parse "jbpm.cfg.xml" I have the same error
:11:15,684 [main] ERROR JpdlXmlReader : couldn't parse process definition
org.dom4j.DocumentException: null Nested exception: null
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.jbpm.jpdl.xml.JpdlParser.parse(JpdlParser.java:57)
at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:138)
at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:172)
at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:153)
at com.sample.action.Dep.main(Dep.java:38)
Nested exception:
java.net.MalformedURLException
at java.net.URL.(URL.java:601)
at java.net.URL.(URL.java:464)
at java.net.URL.(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.jbpm.jpdl.xml.JpdlParser.parse(JpdlParser.java:57)
at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:138)
at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:172)
at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:153)
at com.sample.action.Dep.main(Dep.java:38)
Exception in thread "main" org.jbpm.jpdl.JpdlException: [[ERROR] couldn't parse process definition]
at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:163)
at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:172)
at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:153)
at com.sample.action.Dep.main(Dep.java:38)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021924#4021924
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021924
19Â years, 2Â months
[JBossCache] - Bug? maximum number of expressions in a list is 1000
by gmeroz
I'm usning JBossCache-all-2.0.0.ALPHA2 with Oracle. When i try to remove the root of my cache, i get the following error.
It looks like a bug...
| 09:41:43,802 ERROR [JDBCCacheLoader] Failed to remove node /aag
|
| java.sql.SQLException: ORA-01795: maximum number of expressions in a list is 1000
|
|
|
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
|
| at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
|
| at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
|
| at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:626)
|
| at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:182)
|
| at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:630)
|
| at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1081)
|
| at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2905)
|
| at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2977)
|
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227)
|
| at org.jboss.cache.loader.JDBCCacheLoader.remove(JDBCCacheLoader.java:376)
|
| at org.jboss.cache.loader.AbstractCacheLoader.put(AbstractCacheLoader.java:211)
|
| at org.jboss.cache.loader.JDBCCacheLoader.prepare(JDBCCacheLoader.java:431)
|
| at org.jboss.cache.interceptors.CacheStoreInterceptor.prepareCacheLoader(CacheStoreInterceptor.java:378)
|
| at org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(CacheStoreInterceptor.java:142)
|
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
|
| at org.jboss.cache.interceptors.NotificationInterceptor.invoke(NotificationInterceptor.java:22)
|
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
|
| at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:802)
|
| at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1058)
|
| at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:74)
|
| at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1473)
|
| at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1092)
|
| at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:306)
|
| at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:486)
|
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:346)
|
| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
|
| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
|
| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
|
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
|
| at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
|
| at org.jboss.ejb.Container.invoke(Container.java:873)
|
| at sun.reflect.GeneratedMethodAccessor124.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:141)
|
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
|
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
|
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
|
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
|
| at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
|
| at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
|
| at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
|
| at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
|
| at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
|
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
|
| at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
|
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
|
| at $Proxy55.reloadSingletons(Unknown Source)
|
| 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.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:204)
|
| at com.bevents.infra.service.axis.handler.RemoteEJBProvider.performMethodInvocation(RemoteEJBProvider.java:180)
|
| at com.bevents.infra.service.axis.handler.RemoteEJBProvider.invokeMethod(RemoteEJBProvider.java:155)
|
| at org.jboss.axis.providers.java.RPCProvider.invokeTarget(RPCProvider.java:176)
|
| at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
|
| at org.jboss.net.axis.server.EJBProvider.processMessage(EJBProvider.java:224)
|
| at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
|
| at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
|
| at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
|
| at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
|
| at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
|
| at org.jboss.axis.server.AxisServer.invoke(AxisServer.java:355)
|
| at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
|
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
|
| at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
|
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
|
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
|
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
|
| at com.bevents.infra.service.servlet.CompressionFilter.doFilter(CompressionFilter.java:51)
|
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
|
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
|
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
|
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
|
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
|
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
|
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
|
| at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
|
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
|
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
|
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
|
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
|
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
|
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
|
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
|
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
|
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
|
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
|
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
|
| at java.lang.Thread.run(Thread.java:595)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021923#4021923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021923
19Â years, 2Â months
[JNDI/Naming/Network] - When deploying stateful session bean, it shows via JNDI view
by yair.zaslavsky
The definition of the bean is:
@Stateful
@Remote(QueryManager.class)
@RemoteBinding(jndiBinding="ams/QueryComposerManagerBean/Remote")
@Local(QueryManager.class)
@LocalBinding(jndiBinding="ams/QueryComposerManagerBean/Local")
public class AMSQueryManagerBean implements QueryManager {
}
JNDI view shows:
QueryComposerManagerBean (class: org.jnp.interfaces.NamingContext)
| | +- RemoteStatefulProxyFactory (proxy: $Proxy170 implements interface org.jboss.ejb3.ProxyFactory)
| | +- Remote (class: java.lang.Object)
| | +- LocalStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
| | +- Local (class: java.lang.Object)
I manage to lookup it from tomcat, and J2SE clients
I cannot lookup it from a WAR that is a part of the deployed ear (throws class cast exception, this is why i checked the JNDI view).
For stateless session beans, i see Remote and Local are ok in JNDI view.
How can I solve this? (There is no multiple defition in the EAR of the stateful session bean)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021922#4021922
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021922
19Â years, 2Â months