Hi,
In your SessionEJBBean, desc is initialised by being set to null. When is
this changed? If it is not, this could be your NPE
A
Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email:
antoine.borg@... | blog: blog.ricston.com | web: ricston.com
-----Original Message-----
From: NabiL [mailto:
elaomari.nabil@...]
Sent: Friday, September 19, 2008 6:06 AM
To:
user@...
Subject: [mule-user] EJB Connector
Hi All,
I'm having problems (NullPointerException) invoking a SessionBean from
Mule.
Environment:
JDK: 1.5
OS: Windows XP - Service Pack 2 (5.1, x86) jboss-4.2.2.GA
The SessionBean is an EJB 3.0 one:
package com.test1.model;
import javax.annotation.PostConstruct;
import javax.ejb.Stateful;
import javax.interceptor.Interceptors;
@Stateful(name="SessionEJB")
public class SessionEJBBean implements SessionEJBRemote , SessionEJBLocal {
private String desc = null;
public SessionEJBBean() {
}
public void setDesc(String desc) {
this.desc=desc;
}
public String sayHello(String name) {
return "hello :"+desc+" "+name;
}
@PostConstruct
public void onConstruct(){
System.out.println("onConstruct est invoquée !!");
}
}
The JNDI stuff is working ok (i'm not getting NameNotFoundException any
more).
I can successfully invoke this EJB from a standalone client.
Mule-Conf.xml
<connector name="ejbConnector"
className="org.mule.providers.ejb.EjbConnector">
<properties>
<property name="jndiInitialFactory"
value="org.jnp.interfaces.NamingContextFactory"/>
<property name="jndiUrlPkgPrefixes"
value="org.jboss.naming:org.jnp.interfaces"/>
<property name="jndiProviderUrl" value="jnp://localhost:1099"/>
<property name="securityPolicy" value="./conf/security.policy"/>
<property name="pollingFrequency" value="20000"/>
</properties>
</connector>
<inbound-router>
<endpoint
address="ejb://localhost:1099/com/test1/SessionEJB?method=sayHello"
connector="ejbConnector"/>
</inbound-router>
<outbound-router>
<router
className="org.mule.routing.outbound.OutboundPassThroughRouter">
<endpoint address="stream://System.out"/>
</router>
</outbound-router>
ERROR 2008-09-19 03:08:39,843 [main] org.mule.MuleServer:
****************************************************************************
****
Message : Initialisation Failure: Remote EJBObject lookup
failed for
'ejb://localhost:1099/SessionEJB?method=sayHello; nested exception is:
java.lang.NullPointerException
Type : org.mule.providers.ConnectException
Code : MULE_ERROR-84
JavaDoc :
http://mule.mulesource.org/docs/apidocs/org/mule/providers/ConnectException.
html
Object : EjbMessageReceiver{this=2ba88c,
receiverKey=ejb://localhost:1099,
endpoint=ejb://localhost:1099/SessionEJB?method=sayHello}
****************************************************************************
****
Exception stack is:
1. null (java.lang.NullPointerException)
org.mule.providers.ejb.EjbConnector:48
(
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/NullPointerException.html)
2. Remote EJBObject lookup failed for
'ejb://localhost:1099/SessionEJB?method=sayHello; nested exception is:
java.lang.NullPointerException (java.rmi.RemoteException)
org.mule.providers.ejb.EjbConnector:52
(
http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/RemoteException.html)
3. Initialisation Failure: Remote EJBObject lookup failed for
'ejb://localhost:1099/SessionEJB?method=sayHello; nested exception is:
java.lang.NullPointerException (org.mule.providers.ConnectException)
org.mule.providers.AbstractMessageReceiver:432
(
http://mule.mulesource.org/docs/apidocs/org/mule/providers/ConnectException.html)
****************************************************************************
****
Root Exception stack trace:
java.lang.NullPointerException
at
org.mule.providers.ejb.EjbConnector.getRemoteObject(EjbConnector.java:48)
at
org.mule.providers.rmi.RmiMessageReceiver.doConnect(RmiMessageReceiver.java:
86)
at
org.mule.providers.AbstractMessageReceiver.connect(AbstractMessageReceiver.j
ava:411
)
at
org.mule.providers.SingleAttemptConnectionStrategy.doConnect(SingleAttemptCo
nnectio
nStrategy.java:25)
at
org.mule.providers.AbstractConnectionStrategy.connect(AbstractConnectionStra
tegy.ja
va:98)
at
org.mule.providers.AbstractMessageReceiver.connect(AbstractMessageReceiver.j
ava:403
)
at
org.mule.impl.model.AbstractComponent.connectListeners(AbstractComponent.jav
a:628)
at
org.mule.impl.model.AbstractComponent.start(AbstractComponent.java:225)
at
org.mule.impl.model.AbstractComponent.start(AbstractComponent.java:204)
at org.mule.impl.model.AbstractModel.start(AbstractModel.java:323)
at org.mule.MuleManager.start(MuleManager.java:892)
at
org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfig
uration
Builder.java:278)
at
org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfig
uration
Builder.java:218)
at org.mule.MuleServer.initialize(MuleServer.java:294)
at org.mule.MuleServer.run(MuleServer.java:207)
at org.mule.MuleServer.start(MuleServer.java:195)
at org.mule.MuleServer.main(MuleServer.java:166)
****************************************************************************
****
ERROR 2008-09-19 03:08:39,859 [main] org.mule.MuleServer:
****************************************************************************
****
* A Fatal error has occurred while the server was running:
*
* null (java.lang.NullPointerException)
*
*
*
* The error is fatal, the system must shutdown
*
* Server started: 19/09/08 03:08
*
* Server shutdown: 19/09/08 03:08
*
****************************************************************************
****
Who can help me asap.
Thanks in advance
Nabil
--
View this message in context:
http://www.nabble.com/EJB-Connector-tp19565911p19565911.htmlSent from the Mule - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email