[JBossWS] - Re: How to import relative schemas?
by oskar.carlstedt
I posted i Jira issue about this [url]http://jira.jboss.org/jira/browse/JBWS-1798[url].
*******************************************
I deploy an ear file in JBoss5 that contains a war and a jar fil. The jar file contains a SLSB and the war file contains the web service (implemented as a Provider[SOAPMessage]). The war file has the following file structure in the the WEB-INF/wsdl folder:
| WEB-INF/wsdl
| my-service.wsdl
| /imported
| /my-service
| /1.0-SNAPSHOT
| my-service.xsd
| /common
| /1.0-SNAPSHOT
| common.xsd
|
the wsdl file has a schema import like
<xsd:import schemaLocation="imported/my-service/1.0-SNAPSHOT/my-service.xsd" .../>
the my-service.xsd imports the common.xsd file with the following import statement
<xsd:import schemaLocation="../../common/1.0-SNAPSHOT/common.xsd" .../>
Having this configuration will put JBoss into trouble. The error message sent is telling med that parent paths are not allowed, and pointing out to use getParent() instead. So I setting the schemaLocation attribute to getParent()/getParent()/.... will point out another path, but it is completely wrong.
*******************************************
Best
/Oskar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080051#4080051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080051
17Â years, 1Â month
[JBoss Messaging] - JBoss Messaging database backend deadlock
by boniek
2007-08-31 17:14:40,393 WARN [org.jboss.messaging.core.impl.JDBCPersistenceManager] SQLException caught, SQLState 40001 code:1213- assuming deadlock detected, try:1
| com.mysql.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
| at com.mysql.jdbc.SQLError.createSQLException(Unknown Source)
| at com.mysql.jdbc.MysqlIO.checkErrorPacket(Unknown Source)
| at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
| at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
| at com.mysql.jdbc.Connection.execSQL(Unknown Source)
| at com.mysql.jdbc.PreparedStatement.executeInternal(Unknown Source)
| at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
| at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
| at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
| at org.jboss.messaging.core.impl.JDBCPersistenceManager$1HandleBeforeCommit2PCRunner.doTransaction(JDBCPersistenceManager.java:1464)
| at org.jboss.messaging.core.impl.JDBCPersistenceManager$JDBCTxRunner.execute(JDBCPersistenceManager.java:2418)
| at org.jboss.messaging.core.impl.JDBCPersistenceManager$JDBCTxRunner.executeWithRetry(JDBCPersistenceManager.java:2440)
| at org.jboss.messaging.core.impl.JDBCPersistenceManager.handleBeforeCommit2PC(JDBCPersistenceManager.java:1479)
| at org.jboss.messaging.core.impl.JDBCPersistenceManager$TransactionCallback.beforeCommit(JDBCPersistenceManager.java:2380)
| at org.jboss.messaging.core.impl.tx.Transaction.commit(Transaction.java:208)
| at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:467)
| at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:101)
| at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
| at org.jboss.jms.server.container.SecurityAspect.handleSendTransaction(SecurityAspect.java:195)
| at sun.reflect.GeneratedMethodAccessor850.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
| at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
| at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
| at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
| at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.sendTransaction(ConnectionAdvised.java)
| at org.jboss.jms.wireformat.ConnectionSendTransactionRequest.serverInvoke(ConnectionSendTransactionRequest.java:82)
| at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:144)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
| at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:101)
| at org.jboss.remoting.Client.invoke(Client.java:1550)
| at org.jboss.remoting.Client.invoke(Client.java:530)
| at org.jboss.remoting.Client.invoke(Client.java:518)
| at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:186)
| at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:157)
| at org.jboss.jms.client.delegate.ClientConnectionDelegate.org$jboss$jms$client$delegate$ClientConnectionDelegate$sendTransaction$aop(ClientConnectionDelegate.java:221)
| at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
| at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:91)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
| at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
| at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)
| at org.jboss.jms.tx.ResourceManager.sendTransactionXA(ResourceManager.java:637)
| at org.jboss.jms.tx.ResourceManager.commit(ResourceManager.java:393)
| at org.jboss.jms.tx.MessagingXAResource.commit(MessagingXAResource.java:238)
| at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelCommit(XAResourceRecord.java:487)
| at com.arjuna.ats.arjuna.coordinator.BasicAction.doCommit(BasicAction.java:3107)
| at com.arjuna.ats.arjuna.coordinator.BasicAction.doCommit(BasicAction.java:3022)
| at com.arjuna.ats.arjuna.coordinator.BasicAction.phase2Commit(BasicAction.java:2126)
| at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1819)
| at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:88)
| at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
| at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1382)
| at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
| at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
| at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
| at org.jboss.jms.client.container.ClientConsumer.callOnMessage(ClientConsumer.java:157)
| at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:801)
| at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect14.invoke(SessionAspect14.java)
| at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
| at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
| at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
| at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
| at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
| at java.lang.Thread.run(Thread.java:619)
| 2007-08-31 17:14:40,437 WARN [org.jboss.messaging.core.impl.JDBCPersistenceManager] Trying again after a pause
| 2007-08-31 17:14:40,580 WARN [org.jboss.messaging.core.impl.JDBCPersistenceManager] Update worked after retry
Surprising because the traffic to the database is small.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080048#4080048
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080048
17Â years, 1Â month
[Messaging, JMS & JBossMQ] - Re: Unable to get Connection to send a message on the testQu
by jbosspatni
Also attached is the helper class
package com.dummy.util;
import java.util.ArrayList;
import java.util.Enumeration;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.QueueBrowser;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import org.jboss.example.jms.common.Util;
public class MessageUtility {
private ConnectionFactory cf = null;
public void drain(String queueName) throws Exception
{
System.out.println("Inside Message Utility:drain");
InitialContext ic = new InitialContext();
Queue queue = (Queue)ic.lookup(queueName);
ic.close();
System.out.println("Message Utility: Found teh queue");
Session session = null;
Connection conn = null;
try
{
conn = getConnection();
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = session.createConsumer(queue);
System.out.println("Inside Message Utility:Created Consumer");
Message m = null;
do
{
m = consumer.receive(1L);
}
while(m != null);
}
finally
{
if (conn != null)
{
closeConnection(conn);
}
}
}
public void send(String txt, String queueName) throws Exception
{
InitialContext ic = new InitialContext();
System.out.println("Inside Message Utility:send QueueName :"+ queueName);
if (!Util.doesDestinationExist(queueName,ic))
{
System.out.println("Destination " + queueName + " does not exist, deploying it");
Util.deployQueue(queueName,ic);
}
Queue queue = (Queue)ic.lookup(queueName);
System.out.println("Inside Message Utility:send");
ic.close();
Session session = null;
Connection conn = null;
try
{
System.out.println("Inside Message Utility:send: Before getting connection");
conn = getConnection();
System.out.println("Inside Message Utility:send:After getting connection");
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
System.out.println("Inside Message Utility:send:session" + session);
MessageProducer producer = session.createProducer(queue);
TextMessage tm = session.createTextMessage(txt);
System.out.println("Inside Message Utility:send:producer is "+ producer);
producer.send(tm);
System.out.println("message " + txt + " sent to " + queueName);
}
finally
{
if (conn != null)
{
closeConnection(conn);
}
}
}
public int browse(String queueName) throws Exception
{
InitialContext ic = new InitialContext();
Queue queue = (Queue)ic.lookup(queueName);
ic.close();
System.out.println("Inside Message Utility:browse");
Session session = null;
Connection conn = null;
try
{
conn = getConnection();
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
QueueBrowser browser = session.createBrowser(queue);
ArrayList list = new ArrayList();
for(Enumeration e = browser.getEnumeration(); e.hasMoreElements(); )
{
list.add(e.nextElement());
}
return list.size();
}
finally
{
if (conn != null)
{
closeConnection(conn);
}
}
}
public String receive(String queueName) throws Exception
{
InitialContext ic = new InitialContext();
Queue queue = (Queue)ic.lookup(queueName);
ic.close();
System.out.println("Inside Message Utility:receive");
Session session = null;
Connection conn = null;
try
{
conn = getConnection();
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = session.createConsumer(queue);
System.out.println("blocking to receive message from queue " + queueName + " ...");
TextMessage tm = (TextMessage)consumer.receive(5000);
if (tm == null)
{
throw new Exception("No message!");
}
System.out.println("Message " + tm.getText() + " received");
return tm.getText();
}
finally
{
if (conn != null)
{
closeConnection(conn);
}
}
}
public Connection getConnection() throws Exception
{
Connection connection = null;
System.out.println("Inside Message Utility:send.getConnection:cf"+cf);
try
{
InitialContext ic = new InitialContext();
System.out.println("Inside Message Utility:send.getConnection:ic"+ic);
//cf = (ConnectionFactory)ic.lookup("java:JmsXA");
//cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
cf = (ConnectionFactory)ic.lookup("java:/ConnectionFactory");
System.out.println("Inside Message Utility:send.getConnection:create connection");
connection = cf.createConnection();
System.out.println("Inside Message Utility:send.getConnection:before connection start:conn is"+ connection);
connection.start();
ic.close();
}
catch(Exception e )
{
e.printStackTrace();
if(connection != null)
{
closeConnection(connection);
}
System.out.println("Failed to get connection...exception is " + e);
throw e;
}
return connection;
}
public void closeConnection(Connection con) throws Exception
{
try
{
con.close();
}
catch(JMSException jmse)
{
System.out.println("Could not close connection " + con +" exception was " + jmse);
throw jmse;
}
}
public void initiate()
{
try
{
InitialContext ic = new InitialContext();
//cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
ic.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Please help in fixing this issue
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080047#4080047
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080047
17Â years, 1Â month
[Messaging, JMS & JBossMQ] - Unable to get Connection to send a message on the testQueue
by jbosspatni
Hi,
I am using JBOSS AS 4.2 GA and JBoss Messaging 1.3 GA.I have created an CRUD application with Seam and database is MySQL.From the entity bean created I am trying to send a message to testQueue on the server.The code from the Stateless session bean messaging example is moved to a utility java class.
So I am getting teh following exception when i try to send te message to teh queue looks like its able to create a connection but fails on connection.start
:08,042 INFO [STDOUT] Hibernate: insert into dummy.ticket_master (faultid, faulttype, faultdesc, faultpriority, faultlocation, deviceid, engineer, ticketpriority, ticketstatus, ticketresolution, approvalcomments, ticketid) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
20:22:08,042 INFO [STDOUT] The Quename is /queue/testQueue
20:22:08,042 INFO [STDOUT] Inside Message Utility:send QueueName :/queue/testQueue
20:22:08,042 INFO [STDOUT] Inside Message Utility:send
20:22:08,042 INFO [STDOUT] Inside Message Utility:send: Before getting connection
20:22:08,042 INFO [STDOUT] Inside Message Utility:send.getConnection:cfJBossConnectionFactory->ConnectionFactoryDelegate[1, SID=0]
20:22:08,042 INFO [STDOUT] Inside Message Utility:send.getConnection:icjavax.naming.InitialContext@e6728c
20:22:08,042 INFO [STDOUT] Inside Message Utility:send.getConnection:create connection
20:22:08,058 INFO [STDOUT] Inside Message Utility:send.getConnection:before connection start:conn isJBossConnection->ConnectionDelegate[20254712, ID=4, SID=0]
20:22:08,074 ERROR [STDERR] java.lang.NullPointerException
20:22:08,074 ERROR [STDERR] at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:86)
20:22:08,074 ERROR [STDERR] at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
20:22:08,074 ERROR [STDERR] at org.jboss.jms.client.delegate.ClientConnectionDelegate$start_N8025343665958530775.invokeNext(ClientConnectionDelegate$start_N8025343665958530775.java)
20:22:08,074 ERROR [STDERR] at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
20:22:08,074 ERROR [STDERR] at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
20:22:08,074 ERROR [STDERR] at org.jboss.jms.client.delegate.ClientConnectionDelegate$start_N8025343665958530775.invokeNext(ClientConnectionDelegate$start_N8025343665958530775.java)
20:22:08,074 ERROR [STDERR] at org.jboss.jms.client.delegate.ClientConnectionDelegate.start(ClientConnectionDelegate.java)
20:22:08,074 ERROR [STDERR] at org.jboss.jms.client.JBossConnection.start(JBossConnection.java:121)
20:22:08,074 ERROR [STDERR] at com.dummy.util.MessageUtility.getConnection(MessageUtility.java:178)
20:22:08,074 ERROR [STDERR] at com.dummy.util.MessageUtility.send(MessageUtility.java:73)
20:22:08,074 ERROR [STDERR] at com.dummy.entity.TicketMasterHome.sendMessage(TicketMasterHome.java:69)
20:22:08,074 ERROR [STDERR] at com.dummy.entity.TicketMasterHome.persist(TicketMasterHome.java:47)
20:22:08,074 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20:22:08,074 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20:22:08,074 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20:22:08,074 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.util.Work.workInTransaction(Work.java:39)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
20:22:08,074 ERROR [STDERR] at com.dummy.entity.TicketMasterHome_$$_javassist_30.persist(TicketMasterHome_$$_javassist_30.java)
20:22:08,074 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20:22:08,074 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20:22:08,074 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20:22:08,074 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
20:22:08,074 ERROR [STDERR] at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
20:22:08,074 ERROR [STDERR] at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:338)
20:22:08,074 ERROR [STDERR] at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
20:22:08,074 ERROR [STDERR] at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
20:22:08,074 ERROR [STDERR] at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
20:22:08,074 ERROR [STDERR] at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
20:22:08,074 ERROR [STDERR] at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
20:22:08,074 ERROR [STDERR] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
20:22:08,074 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:383)
20:22:08,074 ERROR [STDERR] at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
20:22:08,074 ERROR [STDERR] at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
20:22:08,074 ERROR [STDERR] at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
20:22:08,074 ERROR [STDERR] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
20:22:08,074 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
20:22:08,074 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
20:22:08,074 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
20:22:08,074 ERROR [STDERR] at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
20:22:08,074 ERROR [STDERR] at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
20:22:08,074 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
20:22:08,074 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
20:22:08,074 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
20:22:08,074 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
20:22:08,074 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
20:22:08,074 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
20:22:08,074 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
20:22:08,074 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
20:22:08,074 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
20:22:08,074 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
20:22:08,074 INFO [STDOUT] Exception in persisting and send message java.lang.NullPointerException
20:22:10,932 INFO [STDOUT] Hibernate: select ticketmast0_.ticketid as ticketid19_, ticketmast0_.faultid as faultid19_, ticketmast0_.faulttype as faulttype19_, ticketmast0_.faultdesc as faultdesc19_, ticketmast0_.faultpriority as faultpri5_19_, ticketmast0_.faultlocation as faultloc6_19_, ticketmast0_.deviceid as deviceid19_, ticketmast0_.engineer as engineer19_, ticketmast0_.ticketpriority as ticketpr9_19_, ticketmast0_.ticketstatus as tickets10_19_, ticketmast0_.ticketresolution as ticketr11_19_, ticketmast0_.approvalcomments as approva12_19_ from dummy.ticket_master ticketmast0_ limit ?
20:22:11,338 INFO [STDOUT] Hibernate: select count(*) as col_0_0_ from dummy.ticket_master ticketmast0_
The Code for the entity bean and teh helper class are as follows
package com.dummy.entity;
import javax.naming.InitialContext;
import org.jboss.example.jms.common.ExampleSupport;
import org.jboss.example.jms.queue.QueueExample;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;
import com.dummy.util.MessageUtility;
@Name("ticketMasterHome")
public class TicketMasterHome extends EntityHome {
public void setTicketMasterTicketid(Integer id) {
setId(id);
}
public Integer getTicketMasterTicketid() {
return (Integer) getId();
}
@Override
protected TicketMaster createInstance() {
TicketMaster ticketMaster = new TicketMaster();
return ticketMaster;
}
public void wire() {
}
public boolean isWired() {
return true;
}
public TicketMaster getDefinedInstance() {
return isIdDefined() ? getInstance() : null;
}
@Override
public String persist(){
String retValue="";
try
{
retValue = super.persist();
//QueueExample.main(null);
sendMessage();
}
catch(Exception ex)
{
System.out.println("Exception in persisting and send message "+ex);
}
return retValue;
}
public void sendMessage() throws Exception{
InitialContext ic = new InitialContext();
MessageUtility bean = new MessageUtility();
// StatelessSessionExampleHome home =
// (StatelessSessionExampleHome)ic.lookup("ejb/StatelessSessionExample");
//
// StatelessSessionExample bean = home.create();
//
String queueName = "/queue/"+ ExampleSupport.DEFAULT_QUEUE_NAME;
String text = "Hello!";
System.out.println("The Quename is " + queueName);
//bean.drain(queueName);
bean.initiate();
bean.send("Helloooo", queueName);
System.out.println("The " + text + " message was successfully sent to the " + queueName + " queue");
int num = bean.browse(queueName);
System.out.println("Queue browse result: " + num);
String result = bean.receive(queueName);
System.out.println("Received " + result);
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080045#4080045
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080045
17Â years, 1Â month
[JBoss jBPM] - custom task instance problem
by XerXes_BPM
hi everyone!
i have a problem while trying to use custom task instances in jbpm.
for the first test i just wantet to copy the usual taskInstance and add an addittional property. the table gets created in the database and everything seems to work, but in the end when i try to save the process instance i get an hibernate error. i'm using jbpm 3.1.1 with ms sql server 2003 and jboss ide 1.6.
i have done what was mentioned in the userguide and in this forum:
- create a subclass of TaskInstance
| public class CustomTaskInstance extends TaskInstance {
|
| private String customProperty;
|
| public String getCustomProperty() {
| return customProperty;
| }
|
| public void setCustomProperty(String customProperty) {
| this.customProperty = customProperty;
| }
|
| }
|
|
- create an implementation of org.jbpm.taskmgmt.TaskInstanceFactory
| public class CustomTaskInstanceFactoryImpl implements TaskInstanceFactory {
|
| public TaskInstance createTaskInstance(ExecutionContext executionContext) {
|
| //just a simple mapping to CustomTaskInstance
|
| return new CustomTaskInstance();
| }
|
| }
|
|
- update the property jbpm.task.instance.factory to specify the name of custom class
| <bean name='jbpm.task.instance.factory' class='com.dumdidum.pc.CustomTaskInstanceFactoryImpl' singleton='true' />
|
- create a mapping file for the subclass, for mapping the extra properties you want to save
| <?xml version="1.0"?>
|
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| <hibernate-mapping default-access="field">
|
| <class name="com.dumdidum.pc.CustomTaskInstance"
| table="JBPM_CUSTOMTASKINSTANCE"
| discriminator-value="C">
| <id name="id" column="ID_"><generator class="native" /></id>
| <discriminator type="char" column="CLASS_"/>
|
| <property name="name" column="NAME_" />
| <property name="description" column="DESCRIPTION_" type="string_max" length="4000"/>
| <property name="actorId" column="ACTORID_" index="IDX_TASK_ACTORID"/>
| <property name="create" column="CREATE_" />
| <property name="start" column="START_" />
| <property name="end" column="END_" />
| <property name="dueDate" column="DUEDATE_" />
| <property name="priority" column="PRIORITY_" />
| <property name="isCancelled" column="ISCANCELLED_" />
| <property name="isSuspended" column="ISSUSPENDED_" />
| <property name="isOpen" column="ISOPEN_" />
| <property name="isSignalling" column="ISSIGNALLING_" />
| <property name="isBlocking" column="ISBLOCKING_" />
| <property name="customProperty" column="CUSTOMPROPERTY_" />
|
| <many-to-one name="task"
| column="TASK_"
| foreign-key="FK_TASKINST_TASK"/>
| <many-to-one name="token"
| column="TOKEN_"
| foreign-key="FK_TASKINST_TOKEN"/>
| <many-to-one name="swimlaneInstance"
| column="SWIMLANINSTANCE_"
| foreign-key="FK_TASKINST_SLINST"/>
| <many-to-one name="taskMgmtInstance"
| column="TASKMGMTINSTANCE_"
| foreign-key="FK_TASKINST_TMINST"/>
|
| <map name="variableInstances" cascade="all">
| <key column="TASKINSTANCE_" foreign-key="FK_VAR_TSKINST"/>
| <index type="string" column="NAME_" />
| <one-to-many class="org.jbpm.context.exe.VariableInstance" />
| </map>
| <set name="pooledActors"
| cascade="all"
| table="JBPM_TASKACTORPOOL">
| <key column="TASKINSTANCE_" foreign-key="FK_TASKACTPL_TSKI"/>
| <many-to-many class="org.jbpm.taskmgmt.exe.PooledActor" column="POOLEDACTOR_" />
| </set>
| <list name="comments" cascade="all" >
| <key column="TASKINSTANCE_" />
| <index column="TASKINSTANCEINDEX_" />
| <one-to-many class="org.jbpm.graph.exe.Comment" />
| </list>
|
| </class>
|
| </hibernate-mapping>
|
|
- add that mapping file to the list of mapping files
| <mapping resource="com/dumdidum/pc/CustomTaskInstance.hbm.xml"/>
|
- use custom assignementHandler
| public class MyAssignmentHandler implements AssignmentHandler {
|
| public void assign(Assignable assignable, ExecutionContext executionContext)
| throws Exception {
|
|
| CustomTaskInstance cti = (CustomTaskInstance) assignable;
| cti.setActorId("UserPc1");
| cti.setCustomProperty("testtest");
|
| }
|
| }
|
|
the simple process:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1" name="simpleTask">
| <start-state name="start">
| <transition name="" to="task1"></transition>
| </start-state>
| <end-state name="end1"></end-state>
| <task-node name="task1">
| <task name="testTask">
| <assignment class="com.dumdidum.pc.MyAssignmentHandler"></assignment>
| </task>
| <transition name="" to="state1"></transition>
| </task-node>
| <state name="state1">
| <transition name="" to="end1"></transition>
| </state>
| </process-definition>
|
the result is the following error when trying to flush the session:
| 17:10:42,305 [main] DEBUG Services : executing default save operations
| 17:10:42,305 [main] DEBUG HibernateSaveOperation : saving process instance
| 17:10:42,305 [main] DEBUG SaveLogsOperation : flushing logs to logging service.
| org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:171)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:141)
| at com.rockwell.pc.JBPMWrapper.participateInProcess(JBPMWrapper.java:218)
| at com.rockwell.pc.ProcessTester.main(ProcessTester.java:36)
| Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)17:10:42,315 [main] WARN JDBCExceptionReporter : SQL Error: 547, SQLState: 23000
| 17:10:42,315 [main] ERROR JDBCExceptionReporter : INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_LOG_TASKINST'. The conflict occurred in database 'JBPM', table 'JBPM_TASKINSTANCE', column 'ID_'.
| 17:10:42,315 [main] DEBUG JbpmContext : closing JbpmContext
| 17:10:42,315 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@1abdac9
| 17:10:42,315 [main] DEBUG DbPersistenceService : committing hibernate transaction
| 17:10:42,325 [main] ERROR AssertionFailure : an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
| org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:161)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:141)
| at com.rockwell.pc.JBPMWrapper.participateInProcess(JBPMWrapper.java:218)
| at com.rockwell.pc.ProcessTester.main(ProcessTester.java:36)
| 17:10:42,345 [main] ERROR Services : problem closing service 'persistence'
| org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:171)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:141)
| at com.rockwell.pc.JBPMWrapper.participateInProcess(JBPMWrapper.java:218)
| at com.rockwell.pc.ProcessTester.main(ProcessTester.java:36)
| Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:161)
| ... 4 more
|
| at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:161)
| ... 4 more
| org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session}
| at org.jbpm.svc.Services.close(Services.java:223)
| at org.jbpm.JbpmContext.close(JbpmContext.java:141)
| at com.rockwell.pc.JBPMWrapper.participateInProcess(JBPMWrapper.java:218)
| at com.rockwell.pc.ProcessTester.main(ProcessTester.java:36)
| Caused by: org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:171)
| at org.jbpm.svc.Services.close(Services.java:211)
| ... 3 more
| Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.taskmgmt.log.TaskAssignLog entry (don't flush the Session after an exception occurs)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
| at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
| at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:161)
| ... 4 more
| 17:10:42,345 [main] DEBUG Services : closing service 'logging': org.jbpm.logging.db.DbLoggingService@1e8c585
|
|
any help would be appreciated!
best regards
gregor
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080044#4080044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080044
17Â years, 1Â month