[JBoss jBPM] - JBPM Process instance delete issue
by arshadnj
We are getting another exception while trying to delete a process instance associated with timers:
Hibernate: delete from JBPM_TOKENVARIABLEMAP where ID_=?
| Hibernate: delete from JBPM_MODULEINSTANCE where ID_=?
| Hibernate: delete from JBPM_PROCESSINSTANCE where ID_=? and VERSION_=?
| 2006-11-01 19:34:10,422 ERROR [org.hibernate.util.JDBCExceptionReporter] - <ERROR: update or delete on "jbpm_processinstance" violates foreign key constraint "fk_timer_prinst" on "jbpm_timer">
| 2006-11-01 19:34:10,422 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] - <Could not synchronize database state with session>
| org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.graph.exe.ProcessInstance#934]
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2308)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2440)
| at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:73)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
| at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:496)
| at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:469)
| at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:266)
| at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
| at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
| at $Proxy6.updateAndAdjustWorkflow(Unknown Source)
| at org.donorschoose.web.control.admin.ProposalDetailController.onFormSubmit(ProposalDetailController.java:127)
| at org.donorschoose.web.control.admin.AdminBaseFormController.onSubmit(AdminBaseFormController.java:137)
| at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:258)
| at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:259)
| at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
| at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
| at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
| at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
| at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
| at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.donorschoose.web.filter.ActionFilter.doFilter(ActionFilter.java:95)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
| at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
| 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.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:868)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.sql.SQLException: ERROR: update or delete on "jbpm_processinstance" violates foreign key constraint "fk_timer_prinst" on "jbpm_timer"
| at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
| at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
| at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
| at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
| at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
| at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2294)
| ... 51 more
| 2006-11-01 19:34:13,456 DEBUG [org.donorschoose.web.filter.ActionFilter] - <The requested page is /dev/admin/proposal_details.html>
| Hibernate: select uridetail0_.id as id110_, uridetail0_.name as name110_, uridetail0_.urigroupId as urigroupId110_ from URI uridetail0_ where uridetail0_.name=?
| 2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.filter.ActionFilter] - <The Priviliges for the requested page are: null>
| 2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.control.admin.ProposalDetailController] - <<admin.AdminBaseFormController> Entered method isFormSubmission>
| 2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.control.admin.ProposalDetailController] - <Displaying new form>
| 2006-11-01 19:34:13,516 DEBUG [org.donorschoose.web.control.admin.ProposalDetailController] - <<formBackingObject> Method entered >
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982701#3982701
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982701
19Â years, 6Â months
[Security & JAAS/JBoss] - Re: Jboss SSO Web Application
by sohil.shahï¼ jboss.com
Nipun-
I think there is some confusion with your JAAS configuration. You don't need to write your own LoginModule. You should just be able to integrate the LoginProvider that you created and use the built-in UserNameAndPasswordLoginModule from the IDM component.
Just follow these steps more or less:
In your web application ear file create the following files jboss-service.xml, jboss-app.xml, and security-config.xml
jboss-service.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <!-- hooking in a login module for the standalone version of JSF Forums -->
| <!-- The custom JAAS login configuration that installs
| a Configuration capable of dynamically updating the
| config settings
| -->
| <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
| name="jboss.security.tests:service=LoginConfig">
| <attribute name="AuthConfig">META-INF/security-config.xml</attribute>
| <depends optional-attribute-name="LoginConfigService">
| jboss.security:service=XMLLoginConfig
| </depends>
| <depends optional-attribute-name="SecurityManagerService">
| jboss.security:service=JaasSecurityManager
| </depends>
| </mbean>
| </server>
|
jboss-app.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <jboss-app>
| <module>
| <service>jboss-service.xml</service>
| </module>
| </jboss-app>
|
security-config.xml
| <?xml version='1.0'?>
| <!DOCTYPE policy PUBLIC
| "-//JBoss//DTD JBOSS Security Config 3.0//EN"
| "http://www.jboss.org/j2ee/dtd/security_config.dtd">
|
| <!-- The JAAS login configuration file for the java:/jaas/jbossweb-form-auth
| security domain used by the security-spec test case
| -->
| <policy>
| <application-policy name="mywebapp">
| <authentication>
| <login-module code="org.jboss.security.idm.UsernameAndPasswordLoginModule" flag="required">
| <module-option name="unauthenticatedIdentity">guest</module-option>
| <module-option name="password-stacking">useFirstPass</module-option>
| <module-option name="authenticatedRoles">Authenticated,RegisteredUsers</module-option>
| </login-module>
| </authentication>
| </application-policy>
| </policy>
|
This will setup your JAAS configuration.
Now inside your war file where the web application is:
look at the following files: context.xml, jboss-web.xml and web.xml
context.xml
| <?xml version="1.0"?>
| <Context>
|
| <!--
| logoutURL - URL for performing logout/signout function in your application
| -->
| <Valve className="org.jboss.security.valve.SSOAutoLogout"
| logoutURL="/test/logout.jsp"/>
|
| <!--
| assertingParty - this is the partnerId of this application as a part of a federation of multiple partner sites
| -->
| <Valve className="org.jboss.security.valve.SSOTokenManager"
| assertingParty="jboss_sso_tester"/>
|
| <!--
| tomcat built-in AuthenticationTypes: FORM,BASIC,DIGEST,CLIENT-CERT
| -->
| <Valve className="org.jboss.security.valve.SSOAutoLogin"
| authType="FORM"/>
| </Context>
|
jboss-web.xml
| <?xml version="1.0"?>
| <jboss-web>
| <security-domain>java:jaas/mywebapp</security-domain>
| </jboss-web>
|
Notice the mywebapp specified in jboss-web.xml must be same as the application-ploicy name specified in security-config.xml specified earlier.
then in your web.xml specify the following security configuration
| <!-- setting up the security constraint -->
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>Authenticated</web-resource-name>
| <description></description>
| <url-pattern>/secure/*</url-pattern>
| </web-resource-collection>
| <auth-constraint>
| <role-name>Authenticated</role-name>
| </auth-constraint>
| </security-constraint>
|
| <!-- setup the Authentication method -->
| <login-config>
| <auth-method>FORM</auth-method>
| <realm-name>My WebApps Login Mechanism</realm-name>
| <form-login-config>
| <form-login-page>/login.jsp</form-login-page>
| <form-error-page>/loginError.jsp</form-error-page>
| </form-login-config>
| </login-config>
|
| <security-role>
| <role-name>Authenticated</role-name>
| </security-role>
|
Also, JAAS logins are handled by the tomcat container and should not be called by application level components like Servlets, Filters, EJB etc...The JAAS login lifecycle is managed by the tomcat container. This is where the SSO token managenement functionality is integrated.
This is probably why you dont see a request.getUserPrincipal() since tomcat didnot update your environment since you called the login module from within your servlet.
Now how will your login screen be displayed....for that use a url like /mywebapp/secure/resource....any resource preceded by the /secure will make tomcat invoke the login usecase if you are not logged in.
/secure is from the web.xml configuration...
| <url-pattern>/secure/*</url-pattern>
|
you can call it /auth or whatever else you prefer.
Also one more thing, for your SSO domain cookie to be placed on your browser, you will need to make sure two things:
1) Login happens properly thorugh the JAAS lifecycle in tomcat
2) When you call your web app...call it with a proper domain url like http://xyz.myapp.com etc....dont use http://localhost since localhost does not equate to any domain, hence the SSO SAML token is not placed
Hope this helps move it along....Its more configuration related issues at this point. Maybe the Wiki docs need to have these details
Thanks
Sohil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982698#3982698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982698
19Â years, 6Â months
[Messaging, JMS & JBossMQ] - Should stopping a destination cause a connection exception
by mveitas
Should stopping a destination via the JMX console, cause an exception to be registered with the client connection? If not, how can I get the client to register an exception via the ExceptionListener interface?
| Properties p = new Properties();
| p.put( "java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
| p.put( "java.naming.provider.url", "jnp://localhost:1099" );
| p.put( "java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" );
|
| try
| {
| Context context = new InitialContext( p );
| ConnectionFactory connectionFactory = ( ConnectionFactory ) context.lookup( "ConnectionFactory" );
| Destination destination = ( Destination ) context.lookup( "queue/B" );
| Connection connection = connectionFactory.createConnection();
| connection.setExceptionListener( new ExceptionListener()
| {
| public void onException( JMSException jmsException )
| {
| System.out.println( "EXCEPTION: " + jmsException );
| }
| } );
| Session session = connection.createSession( false, Session.CLIENT_ACKNOWLEDGE );
| MessageConsumer consumer = session.createConsumer( destination );
| consumer.setMessageListener( new MessageListener()
| {
| public void onMessage( Message message )
| {
| System.out.println( "Message: " + message );
| }
| } );
|
| connection.start();
| }
| catch( Exception e )
| {
| e.printStackTrace();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982697#3982697
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982697
19Â years, 6Â months
[JBoss Eclipse IDE (users)] - Can't configure EJB3 Libraries!
by moweis
I've been trying all sort of solutions, but I can't configure a EJB3 project that I have with JBossIDE (1.6 and 2.0) on Eclipse 3.2.
With 1.6:
-I am unable to create a new Jboss server via the Debug screens.
Nothing happens (except exceptions). I've tried JBoss 3.2.x, 4.0.x.
With 2.0:
-I am able to create a server, but when I tried to add it to my project's Build Path
(using Project->Build Path->Add Libraries->EJB 3 Libraries), it lists the server, but when I select the JBoss server, it doesn't allow me to hit the 'Finish' or 'Next/Continue' buttons. They remained greyed out.
I've seen tickets about it (from MAY! and earlier), but I see no fixes. How have people gotten around this?
I've tried downloading the Bundle for JBoss, I've tried downling Eclipse separately and only adding the plugins for JBoss. All for both 1.6 and 2.0. (I've even tried Eclipe 3.3 Beta).
I can't compile/deploy my EJB 3 project.
Any ideas?
--Thanks
Marwan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982694#3982694
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982694
19Â years, 6Â months