[JBoss jBPM] - Concurrency/Async
by mmusaji
I've done quite a bit of searching and reading on asynchronous processes in jbpm, and I'm slightly confused as to whether or not JBPM 4.0 can handle parallel processes? (not parallel business processes).
My unit test calls 3 processes which should be started by the workflow independently of each other.
| <java class="org.workflow.FindProviders" g="276,7,80,40" method="execute" name="find providers">
| <transition name="" to="fork"/>
| </java>
|
| <fork g="298,85,80,40" name="fork">
| <transition g="-62,-18" name="validate red" to="validate red request"/>
| <transition g="-64,-18" name="validate exp" to="validate exp request"/>
| <transition g="-63,-17" name="validate sys" to="validate sys request"/>
| </fork>
|
| <custom continue="async" name="validate red request" class="org.workflow.Validate1" exp="#{myObj}">
| <transition g="-27,-18" name="" to="join"/>
| </custom>
|
| <custom continue="async" name="validate exp request" class="org.workflow.Validate2" exp="#{myObj}">
| <transition g="-27,-18" name="" to="join"/>
| </custom>
|
| <custom continue="async" name="validate sys request" class="org.workflow.Validate3" exp="#{myObj}">
| <transition g="-27,-18" name="" to="join"/>
| </custom>
|
| <join g="267,368,80,40" name="join">
| <transition name="check results" to="evaluate validation results" g="-47,-16"/>
| </join>
Within classes Validate1, Validate2, Validate3, I put the thread to sleep for different times (2, 3 and 6 seconds). I expected the maximum time for completion would be 6 seconds.
My Unit test does start each job one after the other which, I am hoping is the reason why this is not working as expected. I'm stuck as to how I would write a Unit test to ensure it is happening in parallel.
| List<Job> jobs = managementService.createJobQuery()
| .processInstanceId(processInstanceId)
| .list();
|
| for(Job job: jobs) {
| managementService.executeJob(job.getId());
| }
|
Any suggestions would be much appreciated.
Regards,
M
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250420#4250420
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250420
16 years, 10 months
[JBossWS] - Problem installing jbossws-native-3.1.1.GA onto jboss-4.2.3.
by jse
Hi
I have a problem with my installation of jbossws 3.1.1 over the top of jboss 4.2.3.GA. I get this error:
| 2009-08-19 14:53:36,920 ERROR [org.jboss.deployment.MainDeployer] Could not start deployment: file:/app/jboss-4.2.3.GA/server/fred/tmp/deploy/tmp32687FRED.ear-contents/FRED.war
| java.lang.IllegalStateException: Failed to load org.jboss.wsf.spi.invocation.WebServiceContextFactory: org.jboss.wsf.container.jboss42.WebServiceContextFactoryImpl
| at org.jboss.wsf.spi.util.ServiceLoader.loadFromServices(ServiceLoader.java:97)
| ...
| lots of lines
| ...
| at java.lang.Thread.run(Unknown Source)
| Caused by: java.lang.NoClassDefFoundError: org/jboss/wsf/spi/invocation/WebServiceContextEJB
| at java.lang.Class.getDeclaredConstructors0(Native Method)
| at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
| at java.lang.Class.getConstructor0(Unknown Source)
| at java.lang.Class.newInstance0(Unknown Source)
| at java.lang.Class.newInstance(Unknown Source)
| at org.jboss.wsf.spi.util.ServiceLoader.loadFromServices(ServiceLoader.java:92)
|
Looking at the jbossws-native-3.1.1.GA binary distribution it appears that there is no class org.jboss.wsf.spi.invocation.WebServiceContextEJB. It is not contained within jbossws-spi.jar.... although jbossws-native-core.jar does contain org.jboss.wsf.stack.jbws.WebServiceContextEJB
I can see this class in the jbossws-spi.jar for a jboss 4.2.3 that has not been "upgraded" with jbossws-native-3.1.1
The classes in FRED.war were built using the ws*.bat scripts/code that shipped with the jbossws shipped with Jboss 4.2.3.GA. Not sure if this is relevant.
Any advice gratefully received.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250417#4250417
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250417
16 years, 10 months
[Security & JAAS/JBoss]
by Naveen Adusumilli
I am trying to configure DatabaseServerLoginModule for my web application. I have login page with user name and password when click on submit what should happen I am having one basic question. So when I click on submit, will JBoss check for credentials or we have to check against the database programatically. please let me know I am new to this. please help.
please also send me the sample code if you have for authentication and authroization using JBoss.
regards
16 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Re: GlassfishConfigureListener NoSuchMethodError
by Jadin
ok, here are the relevant files. I do not see any reference to Glassfish here.
faces-config.xml
| <faces-config>
|
| <application>
| <message-bundle>LocalizationResources</message-bundle>
| <locale-config>
| <default-locale>en</default-locale>
| <supported-locale>en</supported-locale>
| <supported-locale>fr</supported-locale>
| </locale-config>
| </application>
|
| <navigation-rule>
| <from-view-id>/login.jsp</from-view-id>
| <navigation-case>
| <from-outcome>success</from-outcome>
| <to-view-id>/portal/index.jsp</to-view-id>
| </navigation-case>
| <navigation-case>
| <from-outcome>failure</from-outcome>
| <to-view-id>/login.jsp</to-view-id>
| </navigation-case>
| </navigation-rule>
|
| <navigation-rule>
| <from-view-id>/portal/webClientSend.jsp</from-view-id>
| <navigation-case>
| <from-outcome>success</from-outcome>
| <to-view-id>/portal/webClientSendResult.jsp</to-view-id>
| </navigation-case>
| <navigation-case>
| <from-outcome>failure</from-outcome>
| <to-view-id>/portal/webClientFailure.jsp</to-view-id>
| </navigation-case>
| </navigation-rule>
|
| <managed-bean>
| <description>Used managing the current Locale.</description>
| <managed-bean-name>localeBean</managed-bean-name>
| <managed-bean-class>net.sourceforge.gateway.sstp.faces.beans.LocaleBean</managed-bean-class>
| <managed-bean-scope>session</managed-bean-scope>
| </managed-bean>
|
| <managed-bean>
| <description>Authenticates Users</description>
| <managed-bean-name>loginBean</managed-bean-name>
| <managed-bean-class>net.sourceforge.gateway.sstp.faces.beans.LoginBean</managed-bean-class>
| <managed-bean-scope>session</managed-bean-scope>
| <managed-property>
| <property-name>user</property-name>
| <value>#{sessionScope.user}</value>
| </managed-property>
| </managed-bean>
|
| <managed-bean>
| <description>Gateway Client</description>
| <managed-bean-name>gatewayClientBean</managed-bean-name>
| <managed-bean-class>net.sourceforge.gateway.sstp.faces.beans.GatewayClientBean</managed-bean-class>
| <managed-bean-scope>request</managed-bean-scope>
| </managed-bean>
|
| </faces-config>
|
web.xml
| <web-app>
| <display-name>Gateway Boss Edition</display-name>
|
| <context-param>
| <param-name>contextConfigLocation</param-name>
| <param-value>
| classpath:net/sourceforge/gateway/sstp/webservices/services.xml
| </param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
| <param-value>/faces/myFacesExtensionResource</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.STRICT_XHTML_LINKS</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>server</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
| <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.VIEWSTATE_JAVASCRIPT</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.CONFIG_REFRESH_PERIOD</param-name>
| <param-value>2</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <filter>
| <filter-name>jsp-to-faces-filter</filter-name>
| <filter-class>net.sourceforge.gateway.sstp.faces.filters.DotJspToDotFacesFilter</filter-class>
| </filter>
|
| <filter>
| <filter-name>authorization-filter</filter-name>
| <filter-class>net.sourceforge.gateway.sstp.faces.filters.AuthorizationFilter</filter-class>
| </filter>
|
| <filter>
| <filter-name>ExtensionsFilter</filter-name>
| <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
| <init-param>
| <param-name>uploadMaxFileSize</param-name>
| <param-value>5m</param-value>
| </init-param>
| <init-param>
| <param-name>uploadThresholdSize</param-name>
| <param-value>100k</param-value>
| </init-param>
| </filter>
|
| <filter-mapping>
| <filter-name>jsp-to-faces-filter</filter-name>
| <url-pattern>*.jsp</url-pattern>
| </filter-mapping>
|
| <filter-mapping>
| <filter-name>authorization-filter</filter-name>
| <url-pattern>/portal/*</url-pattern>
| </filter-mapping>
|
|
| <filter-mapping>
| <filter-name>ExtensionsFilter</filter-name>
| <servlet-name>FacesServlet</servlet-name>
| </filter-mapping>
|
| <filter-mapping>
| <filter-name>ExtensionsFilter</filter-name>
| <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| </filter-mapping>
|
| <listener>
| <listener-class>
| org.springframework.web.context.ContextLoaderListener
| </listener-class>
| </listener>
| <servlet>
| <servlet-name>CXFServlet</servlet-name>
| <display-name>CXF Servlet</display-name>
| <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
| </servlet>
|
| <servlet>
| <servlet-name>FacesServlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>3</load-on-startup>
| </servlet>
|
| <servlet>
| <servlet-name>ProcessorServlet</servlet-name>
| <servlet-class>net.sourceforge.gateway.sstp.servlet.ProcessorServlet</servlet-class>
| <load-on-startup>5</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>CXFServlet</servlet-name>
| <url-pattern>/services/*</url-pattern>
| </servlet-mapping>
|
| <servlet-mapping>
| <servlet-name>FacesServlet</servlet-name>
| <url-pattern>*.faces</url-pattern>
| </servlet-mapping>
|
| <welcome-file-list>
| <welcome-file>index.jsp</welcome-file>
| </welcome-file-list>
|
| </web-app>
|
pom.xml
| <dependencies>
| <dependency>
| <groupId>junit</groupId>
| <artifactId>junit</artifactId>
| <version>4.6</version>
| <scope>test</scope>
| </dependency>
| <dependency>
| <groupId>org.mortbay.jetty</groupId>
| <artifactId>jetty</artifactId>
| <version>6.1.9</version>
| <scope>test</scope>
| </dependency>
| <dependency>
| <groupId>org.apache.cxf</groupId>
| <artifactId>cxf-rt-frontend-jaxws</artifactId>
| <version>2.1.3</version>
| </dependency>
| <dependency>
| <groupId>org.apache.cxf</groupId>
| <artifactId>cxf-rt-transports-http</artifactId>
| <version>2.1.3</version>
| </dependency>
| <dependency>
| <groupId>org.apache.cxf</groupId>
| <artifactId>cxf-rt-transports-http-jetty</artifactId>
| <version>2.1.3</version>
| </dependency>
| <dependency>
| <groupId>org.apache.cxf</groupId>
| <artifactId>cxf-rt-ws-security</artifactId>
| <version>2.1.3</version>
| </dependency>
| <dependency>
| <groupId>org.apache.xmlbeans</groupId>
| <artifactId>xmlbeans</artifactId>
| <version>2.3.0</version>
| </dependency>
| <dependency>
| <groupId>org.codehaus.mojo</groupId>
| <artifactId>xmlbeans-maven-plugin</artifactId>
| <version>2.3.0</version>
| </dependency>
| <dependency>
| <groupId>org.slf4j</groupId>
| <artifactId>slf4j-jdk14</artifactId>
| <version>1.5.2</version>
| </dependency>
| <dependency>
| <groupId>org.hibernate</groupId>
| <artifactId>hibernate-core</artifactId>
| <version>3.3.1.GA</version>
| </dependency>
| <dependency>
| <groupId>org.hibernate</groupId>
| <artifactId>hibernate-c3p0</artifactId>
| <version>3.3.1.GA</version>
| </dependency>
| <dependency>
| <groupId>javassist</groupId>
| <artifactId>javassist</artifactId>
| <version>3.8.0.GA</version>
| </dependency>
| <dependency>
| <groupId>hsqldb</groupId>
| <artifactId>hsqldb</artifactId>
| <version>1.8.0.7</version>
| </dependency>
| <dependency>
| <groupId>org.apache.myfaces.tomahawk</groupId>
| <artifactId>tomahawk</artifactId>
| <version>1.1.8</version>
| </dependency>
| <dependency>
| <groupId>javax.faces</groupId>
| <artifactId>jsf-api</artifactId>
| <version>1.2_02</version>
| </dependency>
| <dependency>
| <groupId>javax.faces</groupId>
| <artifactId>jsf-impl</artifactId>
| <version>1.2-b19</version>
| </dependency>
| <dependency>
| <groupId>net.sf.locale4j</groupId>
| <artifactId>locale4j</artifactId>
| <version>1.1.3</version>
| </dependency>
| <dependency>
| <groupId>javax.mail</groupId>
| <artifactId>mail</artifactId>
| <version>1.4.1</version>
| </dependency>
| <dependency>
| <groupId>javax.activation</groupId>
| <artifactId>activation</artifactId>
| <version>1.1</version>
| </dependency>
| <dependency>
| <groupId>org.mortbay.jetty</groupId>
| <artifactId>jsp-api-2.1</artifactId>
| <version>6.1.9</version>
| <scope>test</scope>
| </dependency>
| <dependency>
| <groupId>com.sun.el</groupId>
| <artifactId>el-ri</artifactId>
| <version>1.0</version>
| </dependency>
| <dependency>
| <groupId>mysql</groupId>
| <artifactId>mysql-connector-java</artifactId>
| <version>5.1.6</version>
| </dependency>
| <dependency>
| <groupId>org.hibernate</groupId>
| <artifactId>hibernate-ehcache</artifactId>
| <version>3.3.1.GA</version>
| </dependency>
| <dependency>
| <groupId>commons-fileupload</groupId>
| <artifactId>commons-fileupload</artifactId>
| <version>1.0</version>
| </dependency>
| </dependencies>
| <build>
| <finalName>gateway</finalName>
| <plugins>
| <plugin>
| <groupId>org.apache.cxf</groupId>
| <artifactId>cxf-codegen-plugin</artifactId>
| <version>2.1.3</version>
| <executions>
| <execution>
| <id>generate-sources-sstp</id>
| <phase>generate-sources</phase>
| <configuration>
| <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
| <wsdlOptions>
| <wsdlOption>
| <wsdl>${basedir}/src/main/wsdl/EFileServiceSoap.wsdl</wsdl>
| </wsdlOption>
| </wsdlOptions>
| </configuration>
| <goals>
| <goal>wsdl2java</goal>
| </goals>
| </execution>
| <execution>
| <id>generate-sources-sql</id>
| <phase>generate-sources</phase>
| <configuration>
| <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
| <wsdlOptions>
| <wsdlOption>
| <wsdl>${basedir}/src/main/wsdl/SQLServiceSoap.wsdl</wsdl>
| </wsdlOption>
| </wsdlOptions>
| </configuration>
| <goals>
| <goal>wsdl2java</goal>
| </goals>
| </execution>
| <execution>
| <id>generate-sources-send-trans</id>
| <phase>generate-sources</phase>
| <configuration>
| <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
| <wsdlOptions>
| <wsdlOption>
| <wsdl>${basedir}/src/main/wsdl/SendTransmitters.wsdl</wsdl>
| </wsdlOption>
| </wsdlOptions>
| </configuration>
| <goals>
| <goal>wsdl2java</goal>
| </goals>
| </execution>
| <execution>
| <id>generate-sources-status</id>
| <phase>generate-sources</phase>
| <configuration>
| <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
| <wsdlOptions>
| <wsdlOption>
| <wsdl>${basedir}/src/main/wsdl/GatewayStatus.wsdl</wsdl>
| </wsdlOption>
| </wsdlOptions>
| </configuration>
| <goals>
| <goal>wsdl2java</goal>
| </goals>
| </execution>
| </executions>
| </plugin>
| <plugin>
| <groupId>org.codehaus.mojo</groupId>
| <artifactId>xmlbeans-maven-plugin</artifactId>
| <executions>
| <execution>
| <goals>
| <goal>xmlbeans</goal>
| </goals>
| </execution>
| </executions>
| <inherited>true</inherited>
| <configuration>
| <schemaDirectory>${basedir}/src/main/xsd</schemaDirectory>
| </configuration>
| </plugin>
| <plugin>
| <artifactId>maven-compiler-plugin</artifactId>
| <configuration>
| <source>1.5</source>
| <target>1.5</target>
| </configuration>
| </plugin>
| <plugin>
| <artifactId>maven-surefire-plugin</artifactId>
| <configuration>
| <skipExec>true</skipExec>
| </configuration>
| <executions>
| <execution>
| <phase>integration-test</phase>
| <goals>
| <goal>test</goal>
| </goals>
| <configuration>
| <!--
| <skipExec>${maven.test.skip.exec}</skipExec>
| -->
| <skipExec>true</skipExec>
| <argLine>-Xms96m -Xmx384m</argLine>
| </configuration>
| </execution>
| </executions>
| </plugin>
| </plugins>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250405#4250405
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250405
16 years, 10 months
[Beginners Corner] - Re: Authentication Error
by lesquivel
Hello Wolfgang and thanks for your reply!
Ok, here is more information thanks for your patience.
I am using JBoss 5.1.0GA - JDK6.
I am also usuing a custom login config. Below is the configuration:
| <application-policy name="MYCOMPANY-login-module">
| <authentication>
| <login-module code="org.MYCOMPANY.security.auth.MYCOMPANYLoginModule" flag="required">
| <module-option name = "mode">USER</module-option>
|
| </login-module>
|
| </authentication>
| </application-policy>
|
|
Part of the Login Module Code:
|
| public boolean login() throws LoginException
| {
| Session ses = null;
| try
| {
| valid = false;
| int code;
| NameCallback n = new NameCallback("User Name - ", "Guest");
| PasswordCallback p = new PasswordCallback("Password - ", false);
|
| callbackHandler.handle(new Callback[]{n, p});
| userName = n.getName().trim();
| password = new String(p.getPassword()).trim();
| code = General.getLoginID(userName, password); //validate login with username code >0 successfully authenticated
| if (code > 0) //if valid login ID was found for user name and password
| {
| ses = HibernateFactory.getInstance().getSession();
| Login login = (Login)ses.load(Login.class, Integer.toString(code));
| namePrincipal = new MYCOMPANYPrincipal(login);
| valid = true;
| }
| else if (isValidUserName(userName) && Employers.isValidTemporaryPassword(userName, password)) //if user name and password are valid
| {
| NewEmployeePrincipal nep = new NewEmployeePrincipal(userName);
| Login login = new Login();
| login.getAssociations().add(nep);
| login.setCurrentAssociation(nep);
| login.setName(userName);
| namePrincipal = new MYCOMPANYPrincipal(login);
| valid = true;
| }
| if (!valid)
| {
| logger.info("NOT A VALID login() - Invalid Username/Password combination - MYCOMPANYLoginModule.login()");
|
| }
| return valid;
| }
| catch(Throwable t)
| {
| t.printStackTrace();
| logger.error("Exception - MYCOMPANYLoginModule: " , t);
| SessionLog.exception(this.getClass().getName() + ".login() exception: ", t);
| throw new LoginException(this.getClass().getName() + ".login() exception: " + t);
| }
| finally
| {
| if (ses != null)
| {
| try
| {
| ses.close();
| }
| catch(Exception e)
| {
| SessionLog.exception(this.getClass().getName() + ".login() exception: ", e);
| }
| }
| }
| }
|
|
Everything returns as I expect on the login code. I still have more work on my part to integrate another login module that deals with roles for our authentication but what throws me off is that exception message that the security context has not been set.
I hope this is the information you need to help. Please let me know if there is anything else I can look at or post here.
Thanks again!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250404#4250404
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250404
16 years, 10 months