[jBPM Users] - jBPM4 - .bar deployment to embedded jBPM
by nilspreusker
Hi all,
if I'm not mistaken, there is currently no deployment mechanism for .bar files for jBPM as an embedded framework (e.g. in a Spring application). In other words, to deploy both jPDL files and task forms, every resource has to be added separately like this:
deployment.addResourceFromClasspath("be/jorambarrez/jbpm4/demo/taskform/process.jpdl.xml");
| deployment.addResourceFromClasspath("be/jorambarrez/jbpm4/demo/taskform/process.png");
| deployment.addResourceFromClasspath("be/jorambarrez/jbpm4/demo/taskform/verify_request.ftl");
| deployment.addResourceFromClasspath("be/jorambarrez/jbpm4/demo/taskform/request_vacation.ftl");
|
Joram Barrez also mentions this in his blog:
anonymous wrote : Do note that [...] you'll need to add all the forms to the deployment. We're looking into ways of simplifying this in a next release.
I've checked the JIRA, but didn't find anything for the next two releases (4.2 and 4.3). So I'm wondering what the status of this is, maybe someone can point me to a JIRA case or a thread in the development forum that I might have missed... Cheers! Nils
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258178#4258178
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258178
15 years, 3 months
[Security] - Re: Caller unauthorized on using a ejb3 statetlesssessionbea
by praenti
My web.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
| <display-name>CANCardViewer</display-name>
| <context-param>
| <!-- the JAAS Login Domain -->
| <param-name>jaasLoginDomain</param-name>
| <param-value>cancardDomain</param-value>
| </context-param>
| <context-param>
| <!-- the JAAS Client Login Domain -->
| <param-name>jaasClientLoginDomain</param-name>
| <param-value>client-login</param-value>
| </context-param>
| <context-param>
| <param-name>jmesaPreferencesLocation</param-name>
| <param-value>
| /resources/jmesa.properties
| </param-value>
| </context-param>
| <context-param>
| <param-name>jmesaMessagesLocation</param-name>
| <param-value>applicationResources</param-value>
| </context-param>
|
| <filter>
| <filter-name>struts2</filter-name>
| <filter-class>
| org.apache.struts2.dispatcher.FilterDispatcher
| </filter-class>
| </filter>
|
| <!--
| This is not necessary if a ServiceLocator fetches the data from EJB layer
| <filter>
| <filter-name>SpringOpenEntityManagerInViewFilter</filter-name>
| <filter-class>
| org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
| </filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>SpringOpenEntityManagerInViewFilter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
| -->
|
| <filter-mapping>
| <filter-name>struts2</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>worksheet</servlet-name>
| <servlet-class>org.jmesa.worksheet.servlet.WorksheetServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>worksheet</servlet-name>
| <url-pattern>*.wrk</url-pattern>
| </servlet-mapping>
|
|
| <listener>
| <listener-class>
| org.springframework.web.context.ContextLoaderListener
| </listener-class>
| </listener>
|
| <welcome-file-list>
| <welcome-file>index.jsp</welcome-file>
| </welcome-file-list>
|
| </web-app>
|
And the struts2 interceptor I use on sites you have to be logged in:
JaasLoginInterceptor:
| /**
| *
| */
| package vwg.audi.cancard.ui.interceptor;
|
| import javax.servlet.http.HttpServletRequest;
|
| import org.apache.log4j.Logger;
| import org.apache.struts2.ServletActionContext;
|
| import vwg.yyy.cancard.business.LoginFacade;
| import vwg.yyy.cancard.ui.JAASConstants;
|
| import com.opensymphony.xwork2.Action;
| import com.opensymphony.xwork2.ActionInvocation;
| import com.opensymphony.xwork2.interceptor.Interceptor;
|
| /**
| * JAASLoginFilter
| *
| * @author Michael Obster
| */
| public class JAASLoginInterceptor implements Interceptor {
|
| private static final long serialVersionUID = -1983088770872827621L;
|
| private Logger log = Logger.getLogger(this.getClass());
|
| String loginDomain = "";
| String clientLoginDomain = "";
|
| LoginFacade loginFacade;
|
| @Override
| public void init() {
|
| }
|
| @Override
| public String intercept(ActionInvocation actionInvocation) throws Exception {
| loginDomain = ServletActionContext.getServletContext().getInitParameter("jaasLoginDomain");
| clientLoginDomain = ServletActionContext.getServletContext().getInitParameter("jaasClientLoginDomain");
| if (log.isDebugEnabled()) {
| log.debug("init JAASInterceptor: loginDomain:" + loginDomain + " clientLoginDomain:" + clientLoginDomain);
| }
|
| HttpServletRequest request = ServletActionContext.getRequest();
| String servletPath = request.getServletPath();
| String pathInfo = request.getPathInfo();
| String path = (servletPath == null ? "" : servletPath)
| + (pathInfo == null ? "" : pathInfo);
| if (log.isDebugEnabled()) {
| log.debug("Login INTERCEPT");
| }
| loginFacade = new LoginFacade(loginDomain, clientLoginDomain);
|
|
| if (!JAASConstants.USER_IS_VALID.equals(request
| .getSession().getAttribute(
| JAASConstants.USER_VALIDITY))) {
| log.info("requested path: " + path);
| return Action.LOGIN;
| }
|
| //Perform client-login
| String username = (String)request.getSession().getAttribute(JAASConstants.USERNAME);
| String strPassword = (String)request.getSession().getAttribute(JAASConstants.PASSWORD);
|
| // Classic login by username and password
| loginFacade.clientLogin(username, strPassword);
| if (log.isDebugEnabled()) {
| log.debug("*****CLIENTLOGIN COMPLETE****");
| }
|
| return actionInvocation.invoke();
| }
|
| @Override
| public void destroy() {
| loginFacade.logout();
| }
|
|
|
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258172#4258172
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258172
15 years, 3 months
[Security] - Re: Caller unauthorized on using a ejb3 statetlesssessionbea
by praenti
Some new output was generated after enabling debugging. But the only thing I can see, that the error is not in the login module but somewhere in the servlet container.
Is there something special that I have to pay attention when I'm using Struts2 as framework?
| ...
| 16:01:50,566 INFO [SpiiderLoginModule] Logged into LDAP server, javax.naming.ld
| ap.InitialLdapContext@6857da
| 16:01:50,581 INFO [SpiiderLoginModule] getRoleSets using rolesQuery: SELECT u.u
| serid, r."role" FROM "security".application_user u, "security".application_role
| r, "security".user_role ur WHERE u.userid = ? AND u.userid = ur.user_id AND ur.r
| ole_id = r."role", gid: 79A44E672EA8C49B
| 16:01:50,769 ERROR [[default]] Servlet.service() for servlet default threw excep
| tion
| javax.ejb.EJBAccessException: Caller unauthorized
| ...
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258167#4258167
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258167
15 years, 3 months
[jBPM Users] - jbpm 4.1 : Running jbpm test case - issue
by makarandk502
Hi,
Can anybody guide me in resolving this issue ?
I am getting following error while running following jbpm test case
I have also attached process xml file
----
Error
|
| 18:07:16,924 FIN | [BaseJbpmTestCase] === starting testTaskAssignee =============================
| ### EXCEPTION ###########################################
| 18:07:16,954 INF | [Parser] couldn't set schema language property
| org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
| at gnu.xml.aelfred2.XmlReader.getProperty(XmlReader.java:181)
| at gnu.xml.aelfred2.XmlReader.setProperty(XmlReader.java:166)
| at gnu.xml.aelfred2.JAXPFactory$JaxpParser.setProperty(JAXPFactory.java:147)
| at org.jbpm.pvm.internal.xml.Parser.buildDom(Parser.java:423)
| at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:389)
| at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:157)
| at org.jbpm.pvm.internal.wire.xml.WireParser.<clinit>(WireParser.java:279)
| at org.jbpm.pvm.internal.env.JbpmConfigurationParser.<init>(JbpmConfigurationParser.java:47)
| at org.jbpm.pvm.internal.env.JbpmConfigurationParser.<clinit>(JbpmConfigurationParser.java:50)
| at org.jbpm.pvm.internal.cfg.JbpmConfiguration.parse(JbpmConfiguration.java:178)
| at org.jbpm.pvm.internal.cfg.JbpmConfiguration.setResource(JbpmConfiguration.java:150)
| at org.jbpm.api.Configuration.setResource(Configuration.java:112)
| at org.jbpm.api.Configuration.getProcessEngine(Configuration.java:164)
| at org.jbpm.test.JbpmTestCase.initialize(JbpmTestCase.java:81)
| at org.jbpm.test.JbpmTestCase.setUp(JbpmTestCase.java:76)
| at tcs.com.java.TaskAssigneeTest.setUp(TaskAssigneeTest.java:41)
| at junit.framework.TestCase.runBare(TestCase.java:128)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:120)
| at junit.framework.TestSuite.runTest(TestSuite.java:230)
| at junit.framework.TestSuite.run(TestSuite.java:225)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
| ### EXCEPTION ###########################################
| ### EXCEPTION ###########################################
| 18:07:16,964 INF | [Parser] couldn't set dynamic validation feature
| org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
| at gnu.xml.aelfred2.SAXDriver.getFeature(SAXDriver.java:414)
| at gnu.xml.aelfred2.XmlReader.getFeature(XmlReader.java:234)
| at gnu.xml.aelfred2.XmlReader.setFeature(XmlReader.java:206)
| at org.jbpm.pvm.internal.xml.Parser.buildDom(Parser.java:437)
| at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:389)
| at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:157)
| at org.jbpm.pvm.internal.wire.xml.WireParser.<clinit>(WireParser.java:279)
| at org.jbpm.pvm.internal.env.JbpmConfigurationParser.<init>(JbpmConfigurationParser.java:47)
| at org.jbpm.pvm.internal.env.JbpmConfigurationParser.<clinit>(JbpmConfigurationParser.java:50)
| at org.jbpm.pvm.internal.cfg.JbpmConfiguration.parse(JbpmConfiguration.java:178)
| at org.jbpm.pvm.internal.cfg.JbpmConfiguration.setResource(JbpmConfiguration.java:150)
| at org.jbpm.api.Configuration.setResource(Configuration.java:112)
| at org.jbpm.api.Configuration.getProcessEngine(Configuration.java:164)
| at org.jbpm.test.JbpmTestCase.initialize(JbpmTestCase.java:81)
| at org.jbpm.test.JbpmTestCase.setUp(JbpmTestCase.java:76)
| at tcs.com.java.TaskAssigneeTest.setUp(TaskAssigneeTest.java:41)
| at junit.framework.TestCase.runBare(TestCase.java:128)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:120)
| at junit.framework.TestSuite.runTest(TestSuite.java:230)
| at junit.framework.TestSuite.run(TestSuite.java:225)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
| ### EXCEPTION ###########################################
|
|
jbpm testcase
|
| package tcs.com.java;
|
| import java.util.HashMap;
| import java.util.List;
| import java.util.Map;
|
| import org.jbpm.api.ProcessInstance;
| import org.jbpm.api.task.Task;
| import org.jbpm.test.JbpmTestCase;
|
|
|
| public class TaskAssigneeTest extends JbpmTestCase {
|
| String deploymentId;
|
| protected void setUp() throws Exception {
| super.setUp();
|
| deploymentId = repositoryService.createDeployment()
| .addResourceFromClasspath("tcs/com/java/process.jpdl.xml")
| .deploy();
| }
|
| protected void tearDown() throws Exception {
| repositoryService.deleteDeploymentCascade(deploymentId);
|
| super.tearDown();
| }
|
| public void testTaskAssignee() {
| Map<String, Object> variables = new HashMap<String, Object>();
| variables.put("order", new Order("johndoe"));
| ProcessInstance processInstance = executionService.startProcessInstanceByKey("TaskAssignee", variables);
| String pid = processInstance.getId();
|
|
| }
| }
|
|
-- Process xml
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="TaskAssignee" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start g="20,20,48,48">
| <transition to="review" />
| </start>
|
| <task name="review"
| assignee="#{order.owner}"
| g="96,16,127,52">
|
| <transition to="wait" />
| </task>
|
| <state name="wait" g="255,16,88,52"/>
|
| </process>
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258158#4258158
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258158
15 years, 3 months