POJO message deployment on ESB Server 4.7 + Jboss Studio 2.1
---------------------------------------------------------------
Key: JBESB-3051
URL:
https://jira.jboss.org/jira/browse/JBESB-3051
Project: JBoss ESB
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.7
Environment: Jboss ESB Server 4.7 + window + Jboss Studio 2.1
Reporter: sandeep yadav
Fix For: 4.7 CP1
hi ,
I am trying to deploty POJO messages to ESB Server.But Whenerver I try to deploy it
through client application is throws an exception
8:27:09,225 ERROR [JmsGatewayListener] Problems invoking method <process>
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.jboss.soa.esb.listeners.gateway.JmsGatewayListener.doRun(JmsGatewayListener.java:156)
at
org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle.run(AbstractThreadedManagedLifecycle.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: No ClassLoaders found for:
org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test.Customer
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
at
org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.io.ObjectInputStream.resolveClass(Unknown Source)
at
org.jboss.messaging.util.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:78)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.jboss.messaging.util.StreamUtils.readObject(StreamUtils.java:154)
at
org.jboss.messaging.core.impl.message.MessageSupport.getPayload(MessageSupport.java:246)
at org.jboss.jms.message.JBossObjectMessage.getObject(JBossObjectMessage.java:125)
at org.jboss.jms.message.ObjectMessageProxy.getObject(ObjectMessageProxy.java:64)
at
org.jboss.soa.esb.listeners.gateway.PackageJmsMessageContents.setESBMessageBody(PackageJmsMessageContents.java:165)
at
org.jboss.soa.esb.listeners.gateway.PackageJmsMessageContents.process(PackageJmsMessageContents.java:89)
... 7 more
18:27:09,241 ERROR [ClosedInterceptor]
ClosedInterceptor.ClientConsumerDelegate[64-l9ley23g-1-bltnx23g-j8uvny-i2s2o4c5]: method
receive() did not go through, the interceptor is CLOSED
Code in my Listener class
public Message displayMessage(Message message) throws Exception {
logHeader();
System.out.println("***********************Enter into Display Message Section
************************************");
Body msgBody = message.getBody();
Customer contents = (Customer) msgBody.get();
StringBuffer sb = new StringBuffer();
sb.append("BEFORE\n");
sb.append(contents.getFirstName());
sb.append(contents.getLastName());
sb.append(contents.getState());
sb.append(contents.getUserName());
sb.append("\nAFTER");
System.out.println(sb);
logFooter();
System.out.println("***********************Enter from Display Message Section
************************************");
return message;
}
and from client class
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, JBoss Inc., and others contributors as indicated
* by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* (C) 2005-2006,
* @author JBoss Inc.
*/
package org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.JMSException;
import javax.jms.QueueConnectionFactory;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueSession;
import javax.jms.QueueSender;
import javax.jms.ObjectMessage;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
Queue que;
public void setupConnection() throws JMSException, NamingException
{
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
que = (Queue) iniCtx.lookup("queue/transform_pojo_gw");
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
System.out.println("Connection Started");
}
public void stop() throws JMSException
{
conn.stop();
session.close();
conn.close();
}
public void sendAMessage(Customer msg) throws JMSException {
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
tm.setStringProperty("jbesbfilename",
"transformedmessageXML2POJO.log");
send.send(tm);
System.out.println("After Sending the message to the queue ");
send.close();
}
public String readAsciiFile(String fileName) throws IOException {
FileReader fr = null;
char[] thechars = null;
try {
File thefile = new File( fileName );
thefile.exists();
fr = new FileReader( thefile );
int size = (int) thefile.length();
thechars = new char[size];
int count, index = 0;
// read in the bytes from the input stream
while( ( count = fr.read( thechars, index, size ) ) > 0 ) {
size -= count;
index += count;
}
} catch(Exception e) {
System.out.println(e);
}
finally {
if( fr != null )
fr.close();
}
return new String(thechars);
} // readAsciiFile
public static void main(String args[]) throws Exception
{
System.out.println("*****************Starting Point of the Application
******************");
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
//String fileContent = sm.readAsciiFile("SampleOrder.xml");
Customer customer=new Customer();
customer.setFirstName("SAndeep");
customer.setLastName("Yadav");
customer.setState("Haryana");
customer.setUserName("SAwan");
System.out.println("-------------------Simple JMS application
--------------------------");
//System.out.println(fileContent);
System.out.println("-----------------After The End Of The
Day----------------------------");
//sm.sendAMessage(fileContent);
sm.sendAMessage(customer);
System.out.println("End of The Main Method");
sm.stop();
}
}
and jboss-esb.xml file
<?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc...
parameterReloadSecs="5">
<providers>
<jms-provider name="JBossMQ"
connection-factory="ConnectionFactory">
<jms-bus busid="quickstartGwChannel">
<jms-message-filter
dest-type="QUEUE"
dest-name="queue/transform_pojo_gw"
/>
</jms-bus>
<jms-bus busid="quickstartEsbChannel">
<jms-message-filter
dest-type="QUEUE"
dest-name="queue/transform_pojo_esb"
/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service
category="MyTransformationServicesESB"
name="MyFirstTransformationServiceESB"
description="ESB: Takes XML in and produces a POJO">
<listeners>
<jms-listener name="JMS-Gateway"
busidref="quickstartGwChannel"
is-gateway="true"
/>
<jms-listener name="jmsTransformer"
busidref="quickstartEsbChannel"
/>
</listeners>
<actions mep="OneWay">
<action name="displayBeforeTransformer"
class="org.jboss.soa.esb.samples.quickstart.transformxml2pojo.MyJMSListenerAction"
process="displayMessage"
/>
<action name="transform"
class="org.jboss.soa.esb.smooks.SmooksAction">
<property name="smooksConfig"
value="/smooks-res.xml" />
<property name="resultType" value="JAVA" />
<!-- property name="reportPath"
value="/zap/smooks-report.html" / -->
</action>
<action name="convertPOJO2Message"
class="org.jboss.soa.esb.dvdstore.DVDStoreAction" />
<action name="displayAfterTransformer"
class="org.jboss.soa.esb.samples.quickstart.transformxml2pojo.MyJMSListenerAction"
process="displayMessage" />
<action name="returnToSender"
class="org.jboss.soa.esb.samples.quickstart.transformxml2pojo.MyJMSListenerAction"
process="sendResponse" />
<action name="println-xml2pojo"
class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value=">>>> Message after Smooks
intermediate xml -> target pojos : " />
</action>
<!-- The next action is for Continuous Integration testing -->
<action name="testStore"
class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
</jbossesb>
Please help me out.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira