You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by davsclaus <ci...@yahoo.dk> on 2011/03/30 13:52:48 UTC

Re: WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)

What version of Camel are you using?

And how do you run it?

-----
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
--
View this message in context: http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p4271325.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)

Posted by superduperguy <sm...@hotmail.com>.
I am using version 2.10.2 so shouldn't have to camel-jboss jar(which I can't
find easily either) and I don't have any special converter which I need to
list. 

All I am trying is modifying the camel-example-jms-file to use my MQ queue
and put contents on queue which will be forwarded to a file in my mbean.


.
.
.
public class PayrollNotificationPublisher2 extends ServiceMBeanSupport
		implements PayrollNotificationPublisher2MBean {
	
	private static final Logger log =
Logger.getLogger(PayrollNotificationPublisher2.class.getCanonicalName());	
	private CamelContext context = null;
	private ProducerTemplate template = null;
	private String outboundQueueName ="/jms/mqseries/MyQ";
	private String queueFactoryName ="/jms/mqseries/MQConnectionFactory";
	
	public PayrollNotificationPublisher2(){}
	
	@Override
	public void startService(){
		setCamelContext();
	}
	
	@Override
	public void stopService(){
        try {
			context.stop();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			log.error(e.getMessage());
		}
	}	
	
	public void setCamelContext() {
		// TODO Auto-generated method stub
        // START SNIPPET: e1
        context = new DefaultCamelContext();
        // END SNIPPET: e1
        // Set up the ActiveMQ JMS Components
        // START SNIPPET: e2
        
		JNDIUtil jndiUtil = new JNDIUtil();
		log.debug("Looking up outbound queue connection factory: " +
queueFactoryName);
		QueueConnectionFactory  connectionFactory =
jndiUtil.getQueueConnectionFactory("vm:"+queueFactoryName);
       
        
        // Note we can explicit name the component
        context.addComponent("jms-mq",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        // END SNIPPET: e2
        // Add some configuration by hand ...
        // START SNIPPET: e3
        try {
			context.addRoutes(new RouteBuilder() {
			    public void configure() {
			       // from("jms-mq:queue:/jms/mqseries/MyQ").to("file://test");
			    	 from("vm:/jms/mqseries/MyQ").to("file://test");
			    }
			});
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			log.error(e.getMessage());
		}
        
        // Camel template - a handy class for kicking off exchanges
        // START SNIPPET: e4
        template = context.createProducerTemplate();
        // END SNIPPET: e4
        // Now everything is set up - lets start the context
        try {
			context.start();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			log.error(e.getMessage());
		}        
	}

	public void sendMessage(String putOnQ) throws JMSException {

        // Now send some test text to a component - for this case a JMS
Queue
        // The text get converted to JMS messages - and sent to the Queue
        // test.queue
        // The file component is listening for messages from the Queue
        // test.queue, consumes
        // them and stores them to disk. The content of each file will be
the
        // test we sent here.
        // The listener on the file component gets notified when new files
are
        // found ... that's it!
        // START SNIPPET: e5
        for (int i = 0; i < 5; i++) {
            //template.sendBody("test-jms:queue:test.queue", putOnQ +" "+
i);
        	template.sendBody("/jms/mqseries/MyQ", putOnQ +" "+ i);
        }
        // END SNIPPET: e5


	}
	
}


I am still getting the same error while creating the default camel context?





--
View this message in context: http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p5724863.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See this FAQ about using JBoss
http://camel.apache.org/how-do-i-run-activemq-and-camel-in-jboss.html



On Thu, Jan 3, 2013 at 5:31 PM, superduperguy <sm...@hotmail.com> wrote:
> I am a newbie to Camel and facing the same issue. Did you find the resolution
> to this issue? I am using Camel 2.10.2 version in Jboss-5.1.1
>
>
> [31-12 00:53:35:471] ERROR
> [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error
> installing to Start: name=iSeries.PayrollNotification:
> service=Listener,name=PayrollNotificationPublisher2 state=Create mode=Manual
> requiredState=Installed
> java.lang.NullPointerException
>         at
> org.apache.camel.impl.WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)
>         at
> org.apache.camel.impl.DefaultCamelContext.<init>(DefaultCamelContext.java:218)
>         at
> com.adp.sbs.dsa.notification.publish.PayrollNotificationPublisher2.setCamelContext(PayrollNotificationPublisher2.java:52)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p5724843.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)

Posted by superduperguy <sm...@hotmail.com>.
I am deploying it as an ear.



--
View this message in context: http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p5724929.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 3, 2013 at 5:31 PM, superduperguy <sm...@hotmail.com> wrote:
> I am a newbie to Camel and facing the same issue. Did you find the resolution
> to this issue? I am using Camel 2.10.2 version in Jboss-5.1.1
>
>
> [31-12 00:53:35:471] ERROR
> [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error
> installing to Start: name=iSeries.PayrollNotification:
> service=Listener,name=PayrollNotificationPublisher2 state=Create mode=Manual
> requiredState=Installed
> java.lang.NullPointerException
>         at
> org.apache.camel.impl.WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)
>         at
> org.apache.camel.impl.DefaultCamelContext.<init>(DefaultCamelContext.java:218)
>         at
> com.adp.sbs.dsa.notification.publish.PayrollNotificationPublisher2.setCamelContext(PayrollNotificationPublisher2.java:52)
>

Thats a odd NPE error as its essentially a class without a classloader.
I have committed a defensive fix in the Camel codebase to avoid this
NPE in the future.

How do you deploy your application? Is it a WAR or EAR or something else?

>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p5724843.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)

Posted by superduperguy <sm...@hotmail.com>.
I am a newbie to Camel and facing the same issue. Did you find the resolution
to this issue? I am using Camel 2.10.2 version in Jboss-5.1.1


[31-12 00:53:35:471] ERROR
[org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error
installing to Start: name=iSeries.PayrollNotification:
service=Listener,name=PayrollNotificationPublisher2 state=Create mode=Manual
requiredState=Installed
java.lang.NullPointerException
	at
org.apache.camel.impl.WebSpherePackageScanClassResolver.isWebSphereClassLoader(WebSpherePackageScanClassResolver.java:46)
	at
org.apache.camel.impl.DefaultCamelContext.<init>(DefaultCamelContext.java:218)
	at
com.adp.sbs.dsa.notification.publish.PayrollNotificationPublisher2.setCamelContext(PayrollNotificationPublisher2.java:52)



--
View this message in context: http://camel.465427.n5.nabble.com/WebSpherePackageScanClassResolver-isWebSphereClassLoader-WebSpherePackageScanClassResolver-java-46-tp4267695p5724843.html
Sent from the Camel - Users mailing list archive at Nabble.com.