[JBoss jBPM] - Re: Did any one use springmodules to integrate jbpm with spr
by Olivier.ch
Your Hibernate session is closed ... it is a Spring configuration pb, not a JBPM problem ...
In your spring_applicationcontext, you need to declare a Transactionnal service. The transactionnal service is there to do the hibernate proxy and give transactions when needed.
Your object (for exemple facadeService here) where your code is written on use the transactionnal Service to get Hibernate Transaction
Then every methode written in your object will use a Hibernate transaction and then the hibernate session ....
| <bean id="transactionalService"
| class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
| abstract="true">
| <property name="transactionManager">
| <ref bean="transactionManager" />
| </property>
| <property name="transactionAttributes">
| <props>
| <prop key="*">PROPAGATION_REQUIRED</prop>
| </props>
| </property>
| </bean>
|
| <bean id="facadeService" parent="transactionalService">
| <property name="target">
| <bean
| class="ocd.common.workflow.facade.FacadeOCD">
| <property name="jbpmConfiguration">
| <ref bean="jbpmConfiguration" />
| </property>
| </bean>
| </property>
| </bean>
|
|
Olivier
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103239#4103239
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103239
18 years, 7 months
[JBoss Seam] - Error when loading Seam page with a Captcha
by shivdeepk
Hi All,
I get an IllegalArgumentException when trying to load an XHTML page with a Captcha. I use seam-gen and modified the build.xml to include jcaptcha-all.jar. Any help would be very much appreciated:
Exception:
02:13:37,559 ERROR [STDERR] 09-Nov-2007 02:13:37 com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/registration.xhtml]
java.lang.IllegalArgumentException: Setter not found for property class
........
........
environment:
Seam 2.0.0.GA
JBoss 4.2.1.GA
JDK 1.5
Linux (Xubuntu Gutsy)
web.xml:
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
menu.xhtml:
<s:link view="/registration.xhtml" value="Register" rendered="#{not identity.loggedIn}"/>
registration.xhtml:
<h:graphicImage value="/seam/resource/captcha?#{captcha.id}" />
<h:outputLabel for="verifyCaptcha">Please enter the letters shown</h:outputLabel>
<s:div>
<h:inputText id="verifyCaptcha" value="#{captcha.response}" required="true">
<s:validate/>
</h:inputText>
<s:div class="error"><h:message for="verifyCaptcha" /></s:div>
</s:div>
application.xml:
lib/jcaptcha-all.jar
pages.xml:
<page view-id="/registration.xhtml">
<navigation from-action="#{registration.registerUser}">
<redirect view-id="/registration.xhtml"/>
<redirect view-id="/home.xhtml"/>
package structure:
MyApp.ear
META-INF\application.xml
MyApp.war
lib\jcaptcha-all.jar
Thanks in advance.
Kind Regards,
Shivdeep
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103238#4103238
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103238
18 years, 7 months
[JBoss Seam] - Re: fileUpload component - Strange behavior
by carlabramsson
We are having some strange and sporadic errors with the fileupload component in 1.2.0 and 1.2.1 GA too. We loose the viewstate sometimes on some of the pages.
After some debugging, it seems like the problem is with the class that parses the multipart-request and not the UI-component. We noticed this after first removing the UI-compoent from the page, still errors, and then removing the enctype="multipart/form-data" from the form tag. After this, the error never occurs.
Most of the time no exception is thrown, the multipart parser just don't return ANY params at all. Sometimes it only omits the viewstate param. Sometimes it works. Sometimes this expection is thrown:
18:13:08,233 ERROR [ExceptionFilter] exception root cause
| java.lang.ArrayIndexOutOfBoundsException: 2048
| at org.jboss.seam.web.MultipartRequest.checkSequence(MultipartRequest.java:466)
| at org.jboss.seam.web.MultipartRequest.parseRequest(MultipartRequest.java:333)
| at org.jboss.seam.web.MultipartRequest.getParam(MultipartRequest.java:507)
| at org.jboss.seam.web.MultipartRequest.getParameterValues(MultipartRequest.java:579)
| at javax.servlet.ServletRequestWrapper.getParameterValues(ServletRequestWrapper.java:188)
| [clipped]
|
(2048 is the size of the buffer in MultipartRequest, fishy...)
So it's very hard to reproduce as it seems like the error only occurs when the size of the post request is at a specific size and contains a specific number of parameters or something. But I have one view/entity that the error occurs on every time, this eases the debugging...
You are probably seeing the same error, the missing validateForm() could be a result of the viewstate-param not being parsed.
I'm going to use the MultipartRequest-class from Seam 2.0 since it's changed a bit and see if the problem goes away.
(Using Myfaces 1.1.5, Seam 1.2.1GA, Latest stable JBoss RichFaces/Ajax4JSF, removed tomahawk, put the seam-filter first)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103231#4103231
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103231
18 years, 7 months
[JBoss Seam] - Right approach using EntityManager and MDB
by hispeedsurfer
Hi
I have not much experience with MDBs.
I need to use EntityManager in combination with a MDB. As I have seen here in forum an other user have used this in the same way as follow:
MDB
package de.oats.business.mdb;
|
| import javax.annotation.Resource;
| import javax.ejb.ActivationConfigProperty;
| import javax.ejb.MessageDriven;
| import javax.ejb.MessageDrivenContext;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import javax.jms.ObjectMessage;
|
| import org.jboss.annotation.ejb.PoolClass;
| import org.jboss.seam.annotations.In;
|
|
| @MessageDriven(name="QueryMessageBean", activationConfig = {
| @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
| @ActivationConfigProperty(propertyName="destination", propertyValue="queue/oatsMessageQueue")
|
| })
| @PoolClass(value=org.jboss.ejb3.StrictMaxPool.class, maxSize=1)
| public class QueryMessageBean implements MessageListener {
|
| @Resource
| private MessageDrivenContext context;
| @In(create=true)
| private UserQuery userquery;
|
| public void onMessage(Message message) {
| QueryTest name = null;
|
| try {
| if (message instanceof ObjectMessage) {
| ObjectMessage objMessage = (ObjectMessage) message;
| Object obj = objMessage.getObject();
| if (obj instanceof QueryTest) {
| name = (QueryTest) obj;
| userquery.setSqlQuery(name.getSqlQuery());
| userquery.query();
| } else {
| System.err.println("Expecting ProcessDTO in Message");
| }
| } else {
| System.err.println("Expecting Object Message");
| }
| } catch (Throwable t) {
| t.printStackTrace();
| context.setRollbackOnly();
| }
| }
| }
|
|
SLSB
package de.oats.business.mdb;
|
| import java.io.Serializable;
| import java.sql.Connection;
| import java.sql.ResultSet;
| import java.sql.Statement;
| import java.util.Date;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
|
| import de.oats.model.QueryResult;
|
| @Stateless
| @Name("userQuery")
| public class UserQueryBean implements UserQuery{
|
| private String sqlQuery;
|
| private static Connection con = null;
| @PersistenceContext
| private EntityManager entityManager;
|
| public UserQueryBean() {
| super();
| }
|
| public String query(){
| ResultSet rs;
| Statement stmt;
| try {
| con = MysqlCon.getConnection();
| stmt = con.createStatement();
|
| rs = stmt.executeQuery(sqlQuery);
| QueryResult qrslt = null;
| while(rs.next()){
| qrslt = new QueryResult();
| qrslt.setAnzahl(rs.getLong("anzahl"));
| qrslt.setY20gpnum(rs.getString("y20gpnum"));
| qrslt.setLat(rs.getDouble("lat"));
| qrslt.setLon(rs.getDouble("lon"));
|
| entityManager.persist(qrslt);
| }
| entityManager.flush();
| } catch (Exception e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| return "5 seconds for " +kindOfQuery;
| }
| public void setSqlQuery(String sqlQuery) {
| this.sqlQuery = sqlQuery;
| }
|
| }
|
But userquery is always null in spite of @In(create=true)
An other try was to put EntityManager in the ObjectMessage(UserTest) - here is null value on entityManager.
Use Seam 2.0 (seam generatet project) and jboss-4.2.1.GA
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103224#4103224
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103224
18 years, 7 months