Monday, September 26, 2011

Consuming External Web Services in UCM11g

In our project, we were trying to consume external web services from a component in UCM 11g but were unsuccessful for a long time.

The component in 10g to consume web services was working very well but when upgraded to 11g, this component was not working.

In 10g, we bundled the stub classes as a jar and deployed it as part of custom component ($Component/lib). When this component was deployed in 11g, we were getting the below error.

Illegal Argument Exception..............
Interface not visible from class loader.


It was clear from the error that the stub classes are not loaded to the correct class loader.

Finally we achieved it by placing the stub jar in the $DOMAIN_DIR/lib folder where $DOMAIN_DIR is the UCM Domain. Then removed the jar from the component and its class path and restarted and then it started working.

If there is a better solution to the problem, please leave your suggestions as comments.

4 comments:

Unknown said...

I came across a similar issue where I wanted to load a Font from my classpath. Turns out the classpath of your UCM component is NOT a Java classpath. The classes are loaded at startup time for you, but at runtime you don't have access to the classes like you would expect.

The current directory of your running component is actually Weblogic's domain root directory. So putting the lib in the domain lib folder seems to make sense. I haven't come across any documentation on this though.

poornima said...

Hi
I am trying to use the imaging API (IPM) in my WCC custom component.
(Both WCC and Imaging residing in the same domain on the same machine)

I have got my stub classes in the jar files and as you have mentioned in your blog, i have copied them to DOMAIN/lib folder and removed from my component path.

But it always throws the following exception

java.lang.IllegalArgumentException: interface oracle.imaging.LoginService is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:687)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:362)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:934)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1039)
at weblogic.wsee.jaxws.spi.ClientInstancePool.takeSimpleClientInstance(ClientInstancePool.java:376)


Do you have any idea why it keep showing the same error message

Regards
Poornima

poornima said...

Hi
I am trying to use the imaging API (IPM) in my WCC custom component.
(Both WCC and Imaging residing in the same domain on the same machine)

I have got my stub classes in the jar files and as you have mentioned in your blog, i have copied them to DOMAIN/lib folder and removed from my component path.

But it always throws the following exception

java.lang.IllegalArgumentException: interface oracle.imaging.LoginService is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:687)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:362)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:934)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1039)
at weblogic.wsee.jaxws.spi.ClientInstancePool.takeSimpleClientInstance(ClientInstancePool.java:376)


Do you have any idea why it keep showing the same error message

Regards
Poornima

Anonymous said...

I am facing a similar issue while developing an extension for jdeveloper. it is custom JCA adapter. when I am doing a test connection
java.lang.IllegalArgumentException: interface is not visible from class loader
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:616)
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:592)
at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:244)


unable to figure out exact cause.
kindly help