« Return to Thread: EJB Connector

RE: EJB Connector

by NabiL :: Rate this Message:

Reply to Author | View in Thread

Hi antoine,

Hi again,

Important :
1- I modified the SessionEJBBean and SessionEJBRemote by adding a create () method) otherwise nothing is called from mule, why ?

2- Mule-conf.xml : ejb transport should be declared as below otherwise it doesn't work !!
<endpoint address="ejb://localhost:1099/SessionEJB/remote?method=sayHello"  
  connector="ejbConnector"/>

I exported my ejb projet into jar file and imported into mule project.

Now the mule trace looks like this :

INFO  2008-09-25 13:21:13,515 [main] org.mule.providers.ejb.EjbConnector: Registering listener: CallEJB on endpointUri: ejb://localhost:1099/SessionEJB/remote?method=sayHello
INFO  2008-09-25 13:21:13,875 [main] org.mule.providers.ejb.EjbMessageReceiver: methodArgumentsList not set on endpoint, assuming method call has no arguments
ERROR 2008-09-25 13:21:13,875 [main] org.mule.MuleServer:
********************************************************************************
Message               : Initialisation Failure: null
Type                  : org.mule.providers.ConnectException
Code                  : MULE_ERROR-84
JavaDoc               : http://mule.mulesource.org/docs/apidocs/org/mule/providers/ConnectException.html
Object                : EjbMessageReceiver{this=179d854, receiverKey=ejb://localhost:1099, endpoint=ejb://localhost:1099/SessionEJB/remote?method=sayHello}
********************************************************************************
Exception stack is:
1. null (java.lang.NullPointerException)
  org.mule.providers.rmi.RmiMessageReceiver:104 (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/NullPointerException.html)
2. Initialisation Failure: null (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.rmi.RmiMessageReceiver.doConnect(RmiMessageReceiver.java:104)
        at org.mule.providers.AbstractMessageReceiver.connect(AbstractMessageReceiver.java:411)
        at org.mule.providers.SingleAttemptConnectionStrategy.doConnect(SingleAttemptConnectionStrategy.java:25)
        at org.mule.providers.AbstractConnectionStrategy.connect(AbstractConnectionStrategy.java:98)
        at org.mule.providers.AbstractMessageReceiver.connect(AbstractMessageReceiver.java:403)
        at org.mule.impl.model.AbstractComponent.connectListeners(AbstractComponent.java: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(MuleXmlConfigurationBuilder.java:278)
        at org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.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-25 13:21:13,906 [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: 25/09/08 13:21                                               *
* Server shutdown: 25/09/08 13:21                                              *
********************************************************************************



antoine.borg wrote:
Hello Nabil,

The log file states that:

java.lang.ClassNotFoundException: com.test1.model.SessionEJBRemote

Presumably, this is one of your custom POJOs. Is it on the classpath?

A


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoine.borg@ricston.com | blog: blog.ricston.com | web: ricston.com

-----Original Message-----
From: NabiL [mailto:elaomari.nabil@gmail.com]
Sent: Thursday, September 25, 2008 1:15 AM
To: user@mule.codehaus.org
Subject: RE: [mule-user] EJB Connector


hi again,

I forgot to add jbossall-client.jar to the classpath. Now the error message
is changed as shown in the attached file

http://www.nabble.com/file/p19659961/trace%2Bmule_ejb3.txt
trace+mule_ejb3.txt

why ??

NabiL

antoine.borg wrote:
>
> 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@ricston.com | blog: blog.ricston.com | web:
> ricston.com
>
> -----Original Message-----
> From: NabiL [mailto:elaomari.nabil@gmail.com]
> Sent: Friday, September 19, 2008 6:06 AM
> To: user@mule.codehaus.org
> 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/NullPointerExceptio
> n.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/ConnectExc
> eption
> .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(AbstractMessageRece
> iver.j
> ava:411
>
> )
> at
>
> org.mule.providers.SingleAttemptConnectionStrategy.doConnect(SingleAtt
> emptCo
> nnectio
>
> nStrategy.java:25)
> at
>
> org.mule.providers.AbstractConnectionStrategy.connect(AbstractConnecti
> onStra
> tegy.ja
>
> va:98)
> at
>
> org.mule.providers.AbstractMessageReceiver.connect(AbstractMessageRece
> iver.j
> ava:403
>
> )
> at
>
> org.mule.impl.model.AbstractComponent.connectListeners(AbstractCompone
> nt.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(MuleXml
> Config
> uration
>
> Builder.java:278)
> at
>
> org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXml
> Config
> 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.html
> Sent 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
>
>
>
>

--
View this message in context:
http://www.nabble.com/EJB-Connector-tp19565911p19659961.html
Sent 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

 « Return to Thread: EJB Connector