Config files with application class references

Gregg Wonderly <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
I have a Jini application that uses com.sun.jini.start facilities to specify the
launch of the application.  Its configuration file includes some static factory
class usages which are from the application's classpath.  I've started creating
a jar file for launching because I get the exception below.  Thus, I have to
make parts of one services classpath visible in the app classloader to get the
configuration to work.

There is not a case where I get a ClassCastException due to the wrong class
loader being used to load this class because the final call to create the object
from the configuration happens through reflection with the correct context class
loader active (because ServerStarter set's it before service class construction).

This is perhaps a difficult issue.  It would probably be good to visit this and
see if there is a solution which might involve either defering the construction
of things inside of other objects in the configuration, until they are actually
asked for with getEntry(), or perhaps something else.

Gregg Wonderly
============================================

Exception in thread "main" java.lang.NoClassDefFoundError:
some/class/in/the/application/ClassPath
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
         at java.lang.Class.privateGetPublicMethods(Class.java:2547)
         at java.lang.Class.getMethods(Class.java:1410)
         at
net.jini.config.ConfigurationFile.findMethod(ConfigurationFile.java:2416)
         at
net.jini.config.ConfigurationFile$MethodCall.resolve(ConfigurationFile.java:1119)
         at
net.jini.config.ConfigurationFile$Call.resolveArgs(ConfigurationFile.java:1019)
         at
net.jini.config.ConfigurationFile$ArrayConstructor.resolve(ConfigurationFile.java:1162)
         at
net.jini.config.ConfigurationFile$Entry.resolve(ConfigurationFile.java:698)
         at
net.jini.config.ConfigurationFile.getEntryInternal(ConfigurationFile.java:2032)
         at
net.jini.config.AbstractConfiguration.getEntryInternal(AbstractConfiguration.java:340)
         at
net.jini.config.AbstractConfiguration.getEntry(AbstractConfiguration.java:228)
         at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:456)

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.