Hello Dennis,
On Wed, 17 Sep 2014 10:59:46 -0400
Dennis Reedy <
dennis...@gmail.com> wrote:
> Zsolt,
> I'm not sure how Tomcat handles this, you may try this:
> /* If the artifact URL has not been configured, set it up */
> import org.rioproject.url.artifact.ArtifactURLStreamHandlerFactory;
> try {
> new URL("artifact:foo");
> } catch (MalformedURLException e) {
> URL.setURLStreamHandlerFactory(new
> ArtifactURLStreamHandlerFactory());
> }
Things are a bit getting complicated in a servlet environment it seems.
Tomcat sets its own URLStreamHandlerFactory (for jndi lookups) and
setting that factory cannot be done once again.
To trick TC by setting this factory to Rio's via reflection does
not work, just as the canonical way of adding new Handler [*]. In
order TC could use this handler classes/jars should be put under TC's
'endorsed' directory.
[*] -Djava.protocol.handler.pkgs=org.rioproject.url passed to TC
http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
http://jcifs.samba.org/src/docs/faq.html#ukproto
This does help getting rid of 'unknow protocol' message, but induces
NoClassDefFoundErrors (see below). I tried to put all Rio libs to
under endorsed and in a next step the jsk ones () too. Did not help.
Putting Rio libs under TC's 'lib' revives the 'unknown protocol' error.
Has anbody succeeded to make Rio 5.x work in a servlet environment?
I wonder how 4.2 does it differently.
Zsolt
java.lang.NoClassDefFoundError: Could not initialize class
java.rmi.server.RMIClassLoader at
net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138) at
net.jini.io.MarshalInputStream.resolveClass(MarshalInputStream.java:296)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at
net.jini.io.MarshalledInstance.get(MarshalledInstance.java:358) at
com.sun.jini.discovery.DiscoveryV1.doUnicastDiscovery(DiscoveryV1.java:394)
at net.jini.discovery.LookupDiscovery$13.run(LookupDiscovery.java:3393)
at java.security.AccessController.doPrivileged(Native Method) at
net.jini.discovery.LookupDiscovery.doUnicastDiscovery(LookupDiscovery.java:3390)
at
net.jini.discovery.LookupDiscovery.doUnicastDiscovery(LookupDiscovery.java:3421)
at
net.jini.discovery.LookupDiscovery.access$4000(LookupDiscovery.java:696)
at
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask.doRun(LookupDiscovery.java:1762)
at
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask.access$3700(LookupDiscovery.java:1713)
at
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask$1.run(LookupDiscovery.java:1730)
at java.security.AccessController.doPrivileged(Native Method) at
net.jini.security.Security$4.run(Security.java:509) at
java.security.AccessController.doPrivileged(Native Method) at
net.jini.security.Security.doPrivileged(Security.java:507) at
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask.run(LookupDiscovery.java:1728)
at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331)