-
Sep 7th, 2007, 07:11 AM
#1
MalformedURLException no protocol: apache.jar
Dear team,
I am trying to invoke a Simple Remote Stateless session bean. Here is my spring configuration file..
----------------------------------------------------------------
<bean id="serviceAPI" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean"
lazy-init="true">
<property name="jndiName">
<value>ServiceAPI</value>
</property>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfac es.NamingContextFactory</prop>
<prop key="java.naming.factory.url.pkgs">org.jboss.namin g: org.jnp.interfaces</prop>
<prop key="java.naming.provider.url">jnp://myserver.pp.com:15931 </prop>
</props>
</property>
<property name="lookupHomeOnStartup" value="true"/>
<property name="refreshHomeOnConnectFailure" value="false"/>
<property name="businessInterface">
<value>com.api.ServiceAPI</value>
</property>
</bean>
<bean id="myClient" class="com.myclient.AClient">
<property name="serviceAPI">
<ref bean="serviceAPI"/>
</property>
.....................
</bean>
------------------------------------------------------------------------
My Client code looks as below:
------------------------------------------------------------------------
public class AClient {
private ServiceAPI serviceAPI;
private String origin, copydir, prefix;
private String jndiName;
private Object jndiEnvironment;
private Class businessInterface;
public ServiceAPI getServiceAPI() {
return serviceAPI;
}
public void setServiceAPI(ServiceAPI serviceAPI) {
this.serviceAPI = serviceAPI;
}
public void setJndiName(String jndiName) {
this.jndiName = jndiName;
}
public void setJndiEnvironment(Properties jndiEnv) {
this.jndiEnvironment = jndiEnv;
}
public void setBusinessInterface(Class businessInterface) {
this.businessInterface = businessInterface;
}
public void createRevObject(RevObject obj) {
try {
getServiceAPI().createRevObject(obj);
} catch (RemoteException e) {
//do error handling
} catch (SomeException e) {
//do error handling
}
}
------------------------------------------
I am using Tomcat 5.5.7 and my spring configuration file is loaded on the startup of my tomcat. Now the problem is, whenever I try to invoke the client call I get the below exception
----------------------------------------------------
Error creating bean with name 'serviceAPI' defined in ServletContext resource [/WEB-INF/beans/Interface-beans.xml]: Initialization of bean failed; nested exception is javax.naming.CommunicationException: null
javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread;
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: apache.jar
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:1 48)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 33)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingCont ext.java:625)
... 94 more
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: apache.jar
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:249)
at sun.rmi.transport.Transport$1.run(Transport.java:1 48)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.net.MalformedURLException: no protocol: apache.jar
at java.net.URL.<init>(URL.java:537)
at java.net.URL.<init>(URL.java:434)
at java.net.URL.<init>(URL.java:383)
at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHand ler.java:747)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:147)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClas sLoader.java:631)
at org.jboss.system.JBossRMIClassLoader.loadClass(JBo ssRMIClassLoader.java:91)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassL oader.java:257)
at sun.rmi.server.MarshalInputStream.resolveClass(Mar shalInputStream.java:200)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1513)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at javax.naming.CompoundName.readObject(CompoundName. java:554)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRe f.java:297)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:246)
... 6 more
-----------------------------------------
I have been struggling with since half a day now... Can any one of you tell me what could be the reason for getting a MalFormedUrlException and I wonder why the apache.jar is mentioned there. I have all the libraries in my classpath that are required to do the JNDI lookup. Can anyone help please?
Last edited by sudimk; Sep 7th, 2007 at 07:14 AM.
-
Sep 10th, 2007, 07:19 AM
#2
As far as I can tell this is a remote exception, you should look at the jboss log for details.
-
Sep 24th, 2007, 05:21 AM
#3
Resolved!
Hi Team,
Thankfully, this problem was resolved.
I was using apache tomcat 5.5.17. I upgraded to 5.5.20 and I do not see this problem anymore . Need to find out what was missing in 5.5.17 though.
Thanks for all your help.
Regards,
Sudarshan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules