RE: [JBoss-user] JBoss and Java Web Start
Hello, On Thu, 22 Mar 2001, Johan Nordin wrote: > Hi, > > I just fixed the problem, it was not a JBoss problem (of course) =) > > It's a bugg in JWS, > JWS does something wrong with the classloaders. > > Before creating any InitialContext, > this code snipped must be included: > (Found it on the discussion forum for JWS, > http://forum.java.sun.com/read/56761/qAWFW4miqiQgAAY-i#LR).) > > > try { > final ClassLoader jnlpCL = this.getClass().getClassLoader(); > java.awt.EventQueue eq = > java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); > eq.invokeAndWait(new Runnable() { > public void run() { > Thread.currentThread().setContextClassLoader(jnlpCL); > } > }); > } > catch (Exception e) { > } well - it is a jboss problem, jboss is not supplying bytecode for home and remote interfaces at it's codebase (Webserver MBean) ... or for any other class that is in .jars of deployed EJBs (please, correct me if i'm wrong!) ... the possible problem with that would be when implementation of interface as result of EJB methods are returned, one such situation would be: interface that is returned: public interface Test extends java.io.Serializable { public String getName(); } remote interface for ejb: public interface Bean extends EJBObject { Test getTest() throws RemoteException; } bean class: public class BeanBean implements SessionBean { ... public Test getTest() { return new TestImpl(); } ... public static class TestImpl implements Test { public String getName() {return "just a test";} } } in this case remote user must have BeanBean.TestImpl in its classpath and that means that each change of Test implementation makes recompile of client code necessary - if client could obtain bytecode from codebase via RMIClassLoader recompile of it's code after change of Test Implementation would be unnecessary ... Dragan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JBoss and Java Web Start
Hi, I just fixed the problem, it was not a JBoss problem (of course) =) It's a bugg in JWS, JWS does something wrong with the classloaders. Before creating any InitialContext, this code snipped must be included: (Found it on the discussion forum for JWS, http://forum.java.sun.com/read/56761/qAWFW4miqiQgAAY-i#LR).) try { final ClassLoader jnlpCL = this.getClass().getClassLoader(); java.awt.EventQueue eq = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); eq.invokeAndWait(new Runnable() { public void run() { Thread.currentThread().setContextClassLoader(jnlpCL); } }); } catch (Exception e) { } We are evaluating JWS and it looks good, but there are a few bugs and it is not so stable, yet. thank you for your interest // Johan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Michel & > Anke > Sent: den 22 mars 2001 21:04 > To: [EMAIL PROTECTED] > Subject: Re: [JBoss-user] JBoss and Java Web Start > > > Hi, > > I think you need to set the option > -Djavax.naming.initialcontext to the class > that implements the initialcontext (f.e. > javax.naming.InitialContext). I'm not > sure I typed the right option name, so check the JNDI spec for this. > > Do you like Web Start? > > Michel de Groot > > > > Hi ! > > > > We are trying to get a client application communicating > with JBoss to work > > with Java Web Start. > > > > When creating the InitialContext, > > javax.naming.NoInitialContextException... > > (Se stacktrace). > > > > When we directly run the application, there is no problem. > > > > We tried to unpack the jnp-client and jta-spec files and > included them > > into our own application jar file, and the same error occured ! > > > > It really looks like that the file isn't loaded into the > Classpath.. but why > > ? > > > > Anyone having any ideas ? > > > > Regards > > // Johan > > > > ** System configuration > > Win2k > > JDK1.3 > > JBoss 2.0 FINAL and JBoss 2.1 (Tried it both, same problem). > > > > ** The files that are included in the client classpath > > jboss-client.jar > > ejb.jar > > jnp-client.jar > > jta-spec1_0_1.jar > > > > ** Code for creating the InitialContext > > ... > > > > Properties contextProps = new Properties(); > > > > > > > contextProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.inte > rfaces.NamingC > > ontextFactory"); > > contextProps.put("java.naming.factory.url.pkgs", > > "org.jboss.naming"); > > > > if (System.getProperty(Context.PROVIDER_URL) == null) { > > contextProps.put(Context.PROVIDER_URL, "localhost"); > > } > > > > iContext = new InitialContext( contextProps ); > < Exception is > > thrown > > > > ... > > > > ** Stack trace > > javax.naming.NoInitialContextException: Cannot instantiate class: > > org.jnp.interfaces.NamingContextFactory. Root exception is > > java.lang.ClassNotFoundException: > org.jnp.interfaces.NamingContextFactory > > > > at java.net.URLClassLoader$1.run(Unknown Source) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(Unknown Source) > > at java.lang.ClassLoader.loadClass(Unknown Source) > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > > at java.lang.ClassLoader.loadClass(Unknown Source) > > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > > at java.lang.Class.forName0(Native Method) > > at java.lang.Class.forName(Unknown Source) > > at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) > > at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) > > at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) > > at javax.naming.InitialContext.init(Unknown Source) > > at javax.naming.InitialContext.(Unknown Source) > > at > > > se.speakup.kvalitid.jndi.InitialContextFactory.getInitialConte > xt(InitialCont > > extFactory.java:44) > > > > > > johan.nordin > > > > SpeakUp DevCon AB > > Nygatan 3, 803 20 Gävle > > Tel +46-(0)26-600 690, Fax +46-(0)26-600 691 > > Mobile +46-(0)70-778 17 70 > > E-mail [EMAIL PROTECTED], Web www.speakup.se > > > > ___ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-user > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JBoss and Java Web Start
Hi, There is a known problem with 1.0 FCS Java Web Start: it does not set the context class loader on the event dispatch thread. When you create the InitialContext in the main thread it should find the classes. I hope this helps. Wim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Johan Nordin Sent: donderdag 22 maart 2001 13:01 To: [EMAIL PROTECTED] Subject: [JBoss-user] JBoss and Java Web Start Hi ! We are trying to get a client application communicating with JBoss to work with Java Web Start. When creating the InitialContext, javax.naming.NoInitialContextException... (Se stacktrace). When we directly run the application, there is no problem. We tried to unpack the jnp-client and jta-spec files and included them into our own application jar file, and the same error occured ! It really looks like that the file isn't loaded into the Classpath.. but why ? Anyone having any ideas ? Regards // Johan ** System configuration Win2k JDK1.3 JBoss 2.0 FINAL and JBoss 2.1 (Tried it both, same problem). ** The files that are included in the client classpath jboss-client.jar ejb.jar jnp-client.jar jta-spec1_0_1.jar ** Code for creating the InitialContext ... Properties contextProps = new Properties(); contextProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingC ontextFactory"); contextProps.put("java.naming.factory.url.pkgs", "org.jboss.naming"); if (System.getProperty(Context.PROVIDER_URL) == null) { contextProps.put(Context.PROVIDER_URL, "localhost"); } iContext = new InitialContext( contextProps ); < Exception is thrown ... ** Stack trace javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.InitialContext.(Unknown Source) at se.speakup.kvalitid.jndi.InitialContextFactory.getInitialContext(InitialCont extFactory.java:44) johan.nordin SpeakUp DevCon AB Nygatan 3, 803 20 Gävle Tel +46-(0)26-600 690, Fax +46-(0)26-600 691 Mobile +46-(0)70-778 17 70 E-mail [EMAIL PROTECTED], Web www.speakup.se ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] JBoss and Java Web Start
Hi, I think you need to set the option -Djavax.naming.initialcontext to the class that implements the initialcontext (f.e. javax.naming.InitialContext). I'm not sure I typed the right option name, so check the JNDI spec for this. Do you like Web Start? Michel de Groot > Hi ! > > We are trying to get a client application communicating with JBoss to work > with Java Web Start. > > When creating the InitialContext, > javax.naming.NoInitialContextException... > (Se stacktrace). > > When we directly run the application, there is no problem. > > We tried to unpack the jnp-client and jta-spec files and included them > into our own application jar file, and the same error occured ! > > It really looks like that the file isn't loaded into the Classpath.. but why > ? > > Anyone having any ideas ? > > Regards > // Johan > > ** System configuration > Win2k > JDK1.3 > JBoss 2.0 FINAL and JBoss 2.1 (Tried it both, same problem). > > ** The files that are included in the client classpath > jboss-client.jar > ejb.jar > jnp-client.jar > jta-spec1_0_1.jar > > ** Code for creating the InitialContext > ... > > Properties contextProps = new Properties(); > > > contextProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingC > ontextFactory"); > contextProps.put("java.naming.factory.url.pkgs", > "org.jboss.naming"); > > if (System.getProperty(Context.PROVIDER_URL) == null) { > contextProps.put(Context.PROVIDER_URL, "localhost"); > } > > iContext = new InitialContext( contextProps ); < Exception is > thrown > > ... > > ** Stack trace > javax.naming.NoInitialContextException: Cannot instantiate class: > org.jnp.interfaces.NamingContextFactory. Root exception is > java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory > > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Unknown Source) > at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) > at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) > at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) > at javax.naming.InitialContext.init(Unknown Source) > at javax.naming.InitialContext.(Unknown Source) > at > se.speakup.kvalitid.jndi.InitialContextFactory.getInitialContext(InitialCont > extFactory.java:44) > > > johan.nordin > > SpeakUp DevCon AB > Nygatan 3, 803 20 Gävle > Tel +46-(0)26-600 690, Fax +46-(0)26-600 691 > Mobile +46-(0)70-778 17 70 > E-mail [EMAIL PROTECTED], Web www.speakup.se > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user