users@glassfish.java.net

Re: Calling a Web Service From a JRuby on Rails - Application

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Wed, 06 Jan 2010 09:31:49 -0800

I think in method2, there is some mismatch w.r.t. whether the JAX-WS api
is loaded from inside glassfish v3 vs the one coming from JDK.

Method1 should have worked but I would recommend placing the WS client
jar inside your rails app lib directory ($RAILS_ROOT/lib) and see if it
helps. Regardless, this seems to be a bug, report an issue at
https://glassfish.dev.java.net/servlets/ProjectIssues. Also attach the
ws client jar file and a simple rails app.

thanks,

-vivek.

glassfish_at_javadesktop.org wrote:
> Hi,
>
> I want call a web service and display / process the results in a rails application. I created a jar-File that contains a Web Service Client that was generated in Netbeans with JAX-WS-Style. When I put that jar-File into the domains/domain1/lib - Folder and try to include the class to my ruby app via
>
> include_class 'test.TestClient'
>
> I get the error message 'cannot load Java class test.TestClient.
>
> When I put the same jar-File to the domains/domain1/lib/ext - Folder, I can include the class to my ruby app, but I cannot call the Web Service:
>
> INFO: NativeException (java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated: java.lang.ClassCastException):
> java/util/ServiceLoader.java:207:in `fail'
> java/util/ServiceLoader.java:164:in `access$100'
> java/util/ServiceLoader.java:353:in `next'
> java/util/ServiceLoader.java:421:in `next'
> javax/xml/ws/spi/Provider.java:146:in `getProviderUsingServiceLoader'
> javax/xml/ws/spi/Provider.java:106:in `provider'
> javax/xml/ws/Service.java:57:in `<init>'
> com/west_wind/foxcentral/FoxCentral.java:44:in `<init>'
> test/TestClient.java:21:in `getArticles'
> app/controllers/rule_sets_controller.rb:13:in `index'
> haml (2.2.16) lib/sass/plugin/rails.rb:19:in `process'
> file:/C:/Programme/sges-v3/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:133:in `call'
> file:/C:/Programme/sges-v3/glassfish/modules/grizzly-jruby.jar!/rack/handler/grizzly.rb:55:in `call'
>
> I tried both methods from a Java Web Application, too. Method 1 works (in lib-Folder); Method 2 produces the same error as the jruby-app.
>
> Am I putting the jar-File to the wrong directory? Or do I have to include other libs, too?
>
> Thanks,
> Heiko
> [Message sent by forum member 'hzeus' (hzeus_at_gmx.de)]
>
> http://forums.java.net/jive/thread.jspa?messageID=378987
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>