[Security & JAAS/JBoss] - Is there a way to specify my application-policy rules inside
by froger
I have created login-config.xml file inside my WEB-INF directory in Web module. The content is:
| <application-policy name="TopupInvoice">
| <authentication>
| <login-module
| code="com.bluemedia.topupInvoice.util.LoginModule"
| flag="required">
| <module-option name="dsJndiName">
| java:/TopupInvoiceDS
| </module-option>
| <module-option name="principalsQuery">
| select userpassword from tabuser where userlogin = ? and uservalid = true
| </module-option>
| <module-option name="rolesQuery">
| <!-- select userRoles,'Roles' from UserRoles where username=?-->
| select userrole, 'Roles' from tabuser where userlogin = ? and uservalid = true
| </module-option>
| </login-module>
| </authentication>
| </application-policy>
|
Now i started my JBoss 4.2.2 with my application deployed. Everything runs fine and when i want to log in this exception occurs:
| 10:07:57,765 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
| java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
| at org.jboss.security.auth.spi.Util.loadProperties(Util.java:315)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
| 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 javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
| 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 org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:603)
| at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:537)
| at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
| at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:491)
| at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:257)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114532#4114532
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114532
18 years, 4 months
[JBoss Seam] - @End from "join" ends all conversations - unexpected action
by Bernix
I have two beans in conversation scope, beanA and beanB. beanA is backing pageA individually,and beanB is backing pageB individually.
beanA will begin the long-running conversation in pageA at first, then we jump to pageB, pageB will begin(join=true) beanB.
but when we end the joined conversation in beanB.done , the beanA is destroyed as well.....
beanA
@Stateful
| @Scope(CONVERSATION)
| @Name("beanA")
| public class BeanA implements IBeanA {
|
| public BeanA() {
| System.out.println(">>>>>> BeanA is constructed.");
| }
|
| @Begin
| public void init() {
| System.out.println(">>>>>> BeanA is initialized.");
| }
|
| @End
| public void done() {
| System.out.println(">>>>>> BeanA is done.");
| }
|
| @Remove
| public void destroy() {
| System.out.println(">>>>>> BeanA is destroyed.");
| }
| }
beanB
@Stateful
| @Name("beanB")
| @Scope (CONVERSATION)
| public class BeanB implements IBeanB {
|
| public BeanB() {
| System.out.println(">>>>>> BeanB is constructed.");
| }
|
| @Begin(join=true)
| public void init() {
| System.out.println(">>>>>> BeanB is initialized.");
| }
|
| @End(beforeRedirect=true)
| public void done() {
| System.out.println(">>>>>> BeanB is done.");
| }
|
| @Remove
| public void destroy() {
| System.out.println(">>>>>> BeanB is destroyed.");
| }
| }
home.xhtml
<s:link view="/pageA.xhtml" action="#{beanA.init()}" value="Go to beanA">
pageA
<s:link view="/pageB.xhtml" action="#{beanB.init()}" value="Go to beanB"/>
pageB
<h:form>
| <h:commandButton action="#{beanB.done}" value="Done beanB"/>
| </h:form>
pageB.page.xml
<navigation from-action="#{beanB.done}">
| <redirect view-id="/pageA.xhtml"/>
| </navigation>
we do the following steps:
1. enter home page
2. link to pageA
3. link to pageB
4. click "Done beanB" in pageB
then we got the exception.....the log is:
16:31:46,333 INFO [STDOUT] >>>>>> BeanA is constructed.
| 16:31:46,458 INFO [STDOUT] >>>>>> BeanA is initialized.
| 16:31:49,458 INFO [STDOUT] >>>>>> BeanB is constructed.
| 16:31:49,489 INFO [STDOUT] >>>>>> BeanB is initialized.
| 16:31:56,129 INFO [STDOUT] >>>>>> BeanB is done.
| 16:31:56,145 INFO [STDOUT] >>>>>> BeanB is destroyed.
| 16:31:56,161 INFO [STDOUT] >>>>>> BeanA is destroyed.
| 16:31:56,254 INFO [STDOUT] >>>>>> BeanA is constructed.
|
Why the @End in beanB.done() cause the beanA to be destroyed?
We would hope that resume to beanA when beanB is done.
I know we can use nested conversation in beanB,yes,nested conversation works OK.
I just wondering,if I join a conversation,how can I end it then resume to the previous long-running conversation?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114530#4114530
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114530
18 years, 4 months
[JBoss jBPM] - Re: Changing the id of a processDefinition or of a instance?
by rodosa
Thank you very much alex.guizar(a)jboss.com . I thought that it was a problem of configuration because when the Jboss server starts, there is a problem:
| 2007-12-20 09:33:11,375 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDATE4_26_, job0_.PROCESSINSTANCE_ as PROCESSI5_26_, job0_.TOKEN_ as TOKEN6_26_, job0_.TASKINSTANCE_ as TASKINST7_26_, job0_.ISSUSPENDED_ as ISSUSPEN8_26_, job0_.ISEXCLUSIVE_ as ISEXCLUS9_26_, job0_.LOCKOWNER_ as LOCKOWNER10_26_, job0_.LOCKTIME_ as LOCKTIME11_26_, job0_.EXCEPTION_ as EXCEPTION12_26_, job0_.RETRIES_ as RETRIES13_26_, job0_.NAME_ as NAME14_26_, job0_.REPEAT_ as REPEAT15_26_, job0_.TRANSITIONNAME_ as TRANSIT16_26_, job0_.ACTION_ as ACTION17_26_, job0_.GRAPHELEMENTTYPE_ as GRAPHEL18_26_, job0_.GRAPHELEMENT_ as GRAPHEL19_26_, job0_.NODE_ as NODE20_26_, job0_.CLASS_ as CLASS2_26_ from JBPM_JOB job0_ where (job0_.LOCKOWNER_ is null or job0_.LOCKOWNER_=?) and job0_.RETRIES_>0 and job0_.DUEDATE_<=? and job0_.ISSUSPENDED_<>1 order by job0_.DUEDATE_ asc]
| java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDAT' at line 1
| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
| at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
| at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
| at com.mysql.jdbc.Connection.execSQL(Connection.java:3026)
| at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1137)
| at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1231)
| at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
| at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
| at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
| at org.hibernate.loader.Loader.doQuery(Loader.java:662)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
| at org.hibernate.loader.Loader.doList(Loader.java:2145)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
| at org.hibernate.loader.Loader.list(Loader.java:2024)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
| at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:40)
| at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:114)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58)
| 2007-12-20 09:33:11,375 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
| 2007-12-20 09:33:11,375 ERROR [org.hibernate.util.JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDAT' at line 1
| 2007-12-20 09:33:11,375 ERROR [org.jbpm.db.JobSession] org.hibernate.exception.SQLGrammarException: could not execute query
| 2007-12-20 09:33:11,375 DEBUG [org.jbpm.JbpmContext] closing jbpmContext org.jbpm.JbpmContext@13bcbc8
| 2007-12-20 09:33:11,375 DEBUG [org.jbpm.svc.Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@1a17727
| 2007-12-20 09:33:11,375 DEBUG [org.jbpm.persistence.db.DbPersistenceService] committing hibernate transaction org.hibernate.transaction.JDBCTransaction@1712a80
| 2007-12-20 09:33:11,375 DEBUG [org.hibernate.transaction.JDBCTransaction] commit
| 2007-12-20 09:33:11,375 DEBUG [org.hibernate.transaction.JDBCTransaction] re-enabling autocommit
| 2007-12-20 09:33:11,375 DEBUG [org.hibernate.transaction.JDBCTransaction] committed JDBC Connection
| 2007-12-20 09:33:11,375 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
| 2007-12-20 09:33:11,375 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
| 2007-12-20 09:33:11,375 DEBUG [org.jbpm.persistence.db.DbPersistenceService] closing hibernate session
| 2007-12-20 09:33:11,375 DEBUG [org.jbpm.svc.Services] closing service 'tx': org.jbpm.tx.TxService@195bbec
| 2007-12-20 09:33:11,375 ERROR [org.jbpm.job.executor.JobExecutorThread] exception in job executor thread. waiting 640000 milliseconds
| org.jbpm.JbpmException: couldn't get acquirable jobs
| at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:44)
| at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:114)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58)
| Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.loader.Loader.doList(Loader.java:2148)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
| at org.hibernate.loader.Loader.list(Loader.java:2024)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
| at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:40)
| ... 2 more
| Caused by: java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDAT' at line 1
| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
| at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
| at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
| at com.mysql.jdbc.Connection.execSQL(Connection.java:3026)
| at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1137)
| at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1231)
| at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
| at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
| at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
| at org.hibernate.loader.Loader.doQuery(Loader.java:662)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
| at org.hibernate.loader.Loader.doList(Loader.java:2145)
| ... 11 more
|
Any idea of that? I want Jboss jbpm works with MySQL and I made changes following http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpMysqlAsDefaultDS and I changed the hibernate configurations files to get that, but ... when the server starts this uses HSQL dialect, no MySQLDialect. :(
And ... I think that because of this problem ... I can't enter into Jboss jBPM web console (http://localhost:8080/jbpm-console) with the default users.
Thanks in advance
Regrads,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114527#4114527
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114527
18 years, 4 months