[Prévia] [Próxima] [Prévia por assunto] [Próxima por assunto]
[Índice cronológico]
[Índice de assunto]
Descritores
- Subject: Descritores
- From: "Rafael Cosentino" <rcosen@xxxxxxxxx>
- Date: Fri, 9 Jun 2006 10:59:39 -0300
Eu coloquei os descritores em um .jar e o adicionei no classpath
Escrevi os descritores assim:
application-client.xml:
<application-client 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/application-client_1_4.xsd"
version="1.4">
<display-name>webservice client app</display-name>
<service-ref>
<service-ref-name>service/VideoRentalStoreService</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
<wsdl-file>META-INF/wsdl/VideoRental.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
</service-ref>
</application-client>
jboss-client.xml:
<!DOCTYPE jboss-client PUBLIC
"-//JBoss//DTD Application Client
4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
<jboss-client>
<jndi-name>client</jndi-name>
<service-ref>
<service-ref-name>service/VideoRentalStoreService</service-ref-name>
<wsdl-override>http://localhost:8080/webservice?wsdl
</wsdl-override>
</service-ref>
</jboss-client>
Tento obter um proxy
registrado no JNDI assim:
Context ctx = getInitialContext();
Service service = (Service) ctx.lookup("java:comp/env/services/VideoRentalStoreService");
protected InitialContext getInitialContext() throws NamingException
{
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "
org.jboss.naming.client");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
env.setProperty("j2ee.clientName", "client");
return new InitialContext(env);
}
ocorre a seguinte Exception:
javax.naming.NameNotFoundException: client 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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke
(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(
TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall
(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java
:625)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke
(javaURLContextFactory.java:129)
at $Proxy0.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at client.Client.doWork(Client.java:23)
at client.Client.main(Client.java
:63)
o que pode estar errado?
flw,
Cosen