3

I've a project under Eclipse Indigo with JBoss 4.2.2 with back end and front end (using Flash Player).

Now I want to update my project using STS 4.1 for my back end and move the front end in Flash Builder IDE using Adobe AIR.

The back end use the EJB 2 architecture.

In the back end I've created a Dynamic Web Module to interface with front end. It calls EJBs.

Under STS 4.1 I've put Jboss 4.2.3.GA (because the wizard installation haven't the 4.2.2).

When I dispatch front end event to request a DB query, my back end goes in exception.

I try to debug and I've found the problem is on method narrow of PortableRemoteDocument class.

This method goes in exception as follow:

java.lang.ClassCastException : null

I've found other SO questions about this error and the hypothetical cause is the mixed use of EJB2 and EJB3 architectures.

But the same project under Eclipse Indigo works fine.

The used JDK is 7 (for both environment).

The used libs are the same.

Follow my files configuration:

remoting-config.xml:

<destination id="EJB">
    <properties>
        <source>it.spi.jfw.callers.EJBCaller</source>
    </properties>
</destination>

EJBCaller.class calls is the entry point to call different EJBs using this method:

public Document performRequest(final Document req)
    throws ConsumerException
{
    try
    {
        final ServizioRemote remoteInterface = this.getBean(this.beanID);

        return remoteInterface.receiveMessage(req);
    }
    catch (final RemoteException re)
    {
        throw new ConsumerException(message#1", re);
    }
    catch (final IOException ioe)
    {
        throw new ConsumerException("message#2", ioe);
    }
}

This is the configuration of GetEnti EJB:

<session>
     <description><![CDATA[]]></description>
     <display-name>GetEnti</display-name>

     <ejb-name>GetEnti</ejb-name>

     <home>it.spi.jfw.ejbservices.ServizioRemoteHome</home>
     <remote>it.spi.jfw.ejbservices.ServizioRemote</remote>
     <local-home>it.spi.jfw.ejbservices.ServizioLocalHome</local-home>
     <local>it.spi.jfw.ejbservices.ServizioLocal</local>
     <ejb-class>it.spi.anagrafica.servizi.GetEnti</ejb-class>
     <session-type>Stateless</session-type>
     <transaction-type>Container</transaction-type>
</session> 

The GetEnti.java class definition:

public class GetEnti extends BaseServizio {
    // code
}

The BaseServizio.java class definition

public abstract class BaseServizio extends AbstractServizioSessionBean {
    // code
}

The AbstractServizioSessionBean.java class definition

public abstract class AbstractServizioSessionBean extends AbstractServizio implements SessionBean
{
    // code
}

The AbstractServizio.java class definition

public abstract class AbstractServizio implements Servizio
{
    // code
}

The Servizio.java interface definition

public interface Servizio extends Remote {
    // code
}

EDIT

I've copied the JBoss folder under the old server and with my deployed projects works fine. So I suppose this is a particular and customized configuration of JBoss allows to work that.

Martin Lippert
  • 5,988
  • 1
  • 15
  • 18
Joe Taras
  • 15,166
  • 7
  • 42
  • 55

0 Answers0