[Prévia] [Próxima] [Prévia por assunto] [Próxima por assunto]
[Índice cronológico] [Índice de assunto]

Novamente ClassCastException



Eu havia implantado o servidor e como no JNDIView via

 +- jbossws-client (class: org.jnp.interfaces.NamingContext)
 |   +- service (class: org.jnp.interfaces.NamingContext)
 |   |   +- wsvideorental (class: org.jboss.ws.jaxrpc.ServiceReferenceable)

achava que estava tudo certo, mas hj qnd fiz o client e coloquei pra
rodar só tomo

java.lang.ClassCastException: javax.naming.Reference
	at ClienteFachadaWS.main(ClienteFachadaWS.java:14)

quando faço
VideoRentalStoreService service = (VideoRentalStoreService)
						ic.lookup("java:comp/env/service/wsvideorental");

Olhei os outros emails da lista e chequei meu classpath: quando
adiciono o resto dos jars listados, acontece o erro de
serialVersionUID, mas minha jdk é a 1.5.0_06 e não a 1.6! Porque isso
acontece?

Tb percebi que não tinha lido um email onde o colega cita que em
http://localhost:8080/wsvideorental/services ele consegue ver os
serviços, mas aqui o que vejo é "The requested resource
(/wsvideorental/services) is not available." Mas eu consigo acessar o
WSDL via browser e no console do jboss não tenho nenhum erro:

20:25:35,029 INFO  [WSDLFilePublisher] WSDL published to:
file:/opt/jboss-4.0.4.GA/server/all/data/wsdl/wsvideorental.war/VideoRental.wsdl
20:25:35,456 INFO  [ServiceEndpointManager] WebService started:
http://icestorm:8080/wsvideorental/rentalservicerpc
20:25:35,456 INFO  [ServiceEndpointManager] WebService started:
http://icestorm:8080/wsvideorental/rentalservicedoc

Vou postar meus xmls caso haja algum outro erro:

*******************
**** web.xml ****
*******************
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
        xmlns:sod="http://www.ime.usp.br/SOD06";
        version="2.4">
<servlet>
  <servlet-name>RentalServiceRPCServlet</servlet-name>
  <servlet-class>serverWS.RentalServiceRPC_Impl
  </servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>RentalServiceRPCServlet</servlet-name>
  <url-pattern>/rentalservicerpc</url-pattern>
</servlet-mapping>

<servlet>
  <servlet-name>RentalServiceDocServlet</servlet-name>
  <servlet-class>serverWS.RentalServiceDoc_Impl
  </servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>RentalServiceDocServlet</servlet-name>
  <url-pattern>/rentalservicedoc</url-pattern>
</servlet-mapping>
</web-app>

**************************
*** webservices.xml ***
**************************
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee";
        xmlns:sod="http://www.ime.usp.br/SOD06";
        version="2.4">
<webservice-description>
 <webservice-description-name>VideoRentalStore</webservice-description-name>
 <wsdl-file>WEB-INF/wsdl/VideoRental.wsdl</wsdl-file>
 <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
 <port-component>
  <port-component-name>RentalServiceRPCPort</port-component-name>
  <wsdl-port>sod:RentalServiceRPCPort</wsdl-port>
  <service-endpoint-interface>WSVideoRentalStore.RentalServiceRPC
  </service-endpoint-interface>
  <service-impl-bean>
    <servlet-link>RentalServiceRPCServlet</servlet-link>
  </service-impl-bean>
 </port-component>

 <port-component>
  <port-component-name>RentalServiceDocPort</port-component-name>
  <wsdl-port>sod:RentalServiceDocPort</wsdl-port>
  <service-endpoint-interface>WSVideoRentalStore.RentalServiceDoc
  </service-endpoint-interface>
  <service-impl-bean>
    <servlet-link>RentalServiceDocServlet</servlet-link>
  </service-impl-bean>
 </port-component>

</webservice-description>
</webservices>


******************************* *** application-client.xml *** *******************************

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

<application-client xmlns="http://java.sun.com/xml/ns/j2ee";
        xmlns:sod="http://www.ime.usp.br/SOD06";
        version="2.4">
<display-name>VideoRentalStoreWSClient</display-name>
<service-ref>
 <service-ref-name>service/wsvideorental</service-ref-name>
 <service-interface>serverWS.RentalServiceWS
 </service-interface>
 <wsdl-file>USE_JBOSS_CLIENT_XML_OVERRIDE</wsdl-file>
 <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
 <port-component-ref>
  <service-endpoint-interface>WSVideoRentalStore.RentalServiceRPC
  </service-endpoint-interface>
 </port-component-ref>
 <port-component-ref>
  <service-endpoint-interface>WSVideoRentalStore.RentalServiceDoc
  </service-endpoint-interface>
 </port-component-ref>
</service-ref>
</application-client>

*************************
*** jboss-client.xml ***
*************************
<?xml version="1.0" encoding="UTF-8"?>

<!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>jbossws-client</jndi-name>
<service-ref>
  <service-ref-name>service/wsvideorental</service-ref-name>
  <wsdl-override>http://${jboss.bind.address}:8080/wsvideorental/rentalservice?wsdl
  </wsdl-override>
</service-ref>
</jboss-client>