Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mapping Exception to AxisFault - ejb not bound

843833Nov 21 2006
Hi crew!

I'm having problems deploying and publishing my webservice-ejb app. I can access the wsdl generated, but i can't find the ejb classes/interfaces published to the JBoss. I've made the publish and run the ant-build, with the deploy-ejb function. Everytime i try to run a method from the EJB, such as a simple sayHello, it returns:

08:43:43,138 INFO [enterprise] Mapping Exception to AxisFault
javax.naming.NameNotFoundException: NiceThingsBean not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
.
.
.
EJB Classes/Interfaces:
import javax.ejb.EJBLocalObject;

public interface NiceThingsLocal extends EJBLocalObject {
    public String sayHello();
}
import javax.ejb.EJBLocalHome;

public interface NiceThingsLocalHome extends EJBLocalHome {
    NiceThingsLocal create() throws javax.ejb.CreateException;
}
import javax.ejb.*;

public class NiceThingsBean implements SessionBean {
    
    public void ejbCreate() {}

    public void ejbActivate() {}
    public void ejbPassivate()  {}
    public void ejbRemove() {}
    public void setSessionContext(SessionContext sc) {}

    // "Business" Methods:
    public String sayHello() {
        return ( "ASDASDASDASd290582390485239045843");

    }
}
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">

    <display-name>EJB samples for deploying into Axis</display-name>

    <enterprise-beans>
        <session>
            <ejb-name>NiceThingsBean</ejb-name>
            <local-home>samples.ejb.NiceThingsLocalHome</local-home>
            <local>samples.ejb.NiceThingsLocal</local>
            <ejb-class>samples.ejb.NiceThingsBean</ejb-class>
			<session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
        </session>
    </enterprise-beans>
</ejb-jar>
deploy.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="NiceThingsBean" provider="java:EJB">
    <parameter name="beanJndiName" value="NiceThingsBean"/>
    <parameter name="homeInterfaceName" value="samples.ejb.NiceThingsLocalHome"/>
    <parameter name="remoteInterfaceName" value="samples.ejb.NiceThingsLocal"/>
    <parameter name="allowedMethods" value="sayHello"/>
    <beanMapping xmlns:ns="urn:NiceThingsBean" qname="ns:NiceThings"
         languageSpecificType="java:samples.ejb.NiceThings"/>
</service>

</deployment>
ant-build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Session Beans as Web Services" default="deployejb" basedir=".">

    <property environment="env"/>
    <property name="deploy.dir" value="C:/jboss/server/all/deploy"/>
    <property name="app.name" value="wsejb"/>
    <property name="src.dir" value="src"/>
    <property name="metainf.dir" value="WebContent/WEB-INF"/>
 	<property name="axis.dir" location="../../"/>
	<property name="url" value="http://localhost:8080/WSEJB/servlet/AxisServlet"/>

	<path id="classpath.id">
		<fileset dir="${metainf.dir}/lib">
			<include name="*.jar"/>
		</fileset>
    <pathelement location="${deploy.dir}/../lib/jboss-j2ee.jar"/>
    <pathelement location="${build.dir}"/>
	</path>

  <taskdef name="axis-java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask"
    loaderref="axis" >
        <classpath refid="classpath.id"/>
  </taskdef>
  <taskdef name="axis-admin" classname="org.apache.axis.tools.ant.axis.AdminClientTask"
    loaderref="axis" >
        <classpath refid="classpath.id"/>
  </taskdef>
  <taskdef name="axis-wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"
    loaderref="axis" >
        <classpath refid="classpath.id"/>
  </taskdef>
  <target name="deployejb" depends="jar">
        <copy file="${app.name}.jar" todir="${deploy.dir}"/>
    </target>
. . .
can anyone help me!? thanks for help and spent time.

guilherme piccin - guilhermepiccin@gmail.com - Brazil
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2006
Added on Nov 21 2006
0 comments
813 views