javax.naming.NameNotFoundException: service not bound

hi

i am trying to access web services using JNDI lookup.

this is my client code snippet

ctx=new InitialContext();

//customerSessionRemote remote=(customerSessionRemote)ctx.lookup("customer/remote");

Service service=(Service)ctx.lookup("java:comp/env/service/CustomerRegisteration");

try {

EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);

String user=port.validateUser(getUserName(), getPassword());

System.out.println(user);

} catch (ServiceException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

} catch (NamingException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

but i am getting following error,

javax.naming.NameNotFoundException: service not bound

17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)

17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)

17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)

17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:267)

17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:270)

17:55:56,468 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)

17:55:56,484 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:716)

17:55:56,484 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)

17:55:56,484 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)

17:55:56,484 ERROR [STDERR] at client.UserBean.loginUser(UserBean.java:125)

17:55:56,484 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

17:55:56,484 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

17:55:56,484 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

17:55:56,484 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)

17:55:56,484 ERROR [STDERR] at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

17:55:56,484 ERROR [STDERR] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)

17:55:56,484 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:312)

17:55:56,484 ERROR [STDERR] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

17:55:56,484 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

17:55:56,484 ERROR [STDERR] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

17:55:56,484 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

17:55:56,484 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

17:55:56,484 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)

17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

17:55:56,484 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

17:55:56,484 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

17:55:56,484 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

17:55:56,484 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

17:55:56,484 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)

17:55:56,484 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)

please help me in resolving this

[5569 byte] By [patel123a] at [2007-11-27 8:52:16]
# 1
Can you post the descriptor file of the application...like ejb-jar.xml ?...as the required resource does not seem to be mapped to the name which you are looking for
technokraft123a at 2007-7-12 21:07:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

hi

As i am exposing ejb3 components as web servcices there is no deployment descriptor files.its based on annotation.Even i am developing enterprise applicatoin.I am using Jboss app server.

only 2 xml files are there,

persistence.xml and web.xml

should i need to post any other file?

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<context-param>

<param-name>javax.faces.CONFIG_FILES</param-name>

<param-value>/WEB-INF/faces-config.xml</param-value>

</context-param>

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>0</load-on-startup>

</servlet>

<servlet>

<description>This is the description of my J2EE component</description>

<display-name>This is the display name of my J2EE component</display-name>

<servlet-name>AccountListServlet</servlet-name>

<servlet-class>client.AccountListServlet</servlet-class>

</servlet>

<servlet>

<description>This is the description of my J2EE component</description>

<display-name>This is the display name of my J2EE component</display-name>

<servlet-name>accountDetailServlet</servlet-name>

<servlet-class>client.accountDetailServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.faces</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>AccountListServlet</servlet-name>

<url-pattern>/AccountListServlet</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>accountDetailServlet</servlet-name>

<url-pattern>/accountDetailServlet</url-pattern>

</servlet-mapping>

<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>

</web-app>

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>

<persistence xmlns="http://java.sun.com/xml/ns/persistence"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/persistence

http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">

<persistence-unit name="customer" transaction-type="JTA">

<jta-data-source>java:/MSSqlDS</jta-data-source>

<properties>

<property name="hibernate.hbm2ddl.auto" value="update" />

<property name="hibernate.show_sql" value="true" />

<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />

</properties>

</persistence-unit>

</persistence>

could u tell me where i went wrong?

patel123a at 2007-7-12 21:07:25 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...