Hi,
Got the following situation:
- Started a developer
- Canceled the “select solution” dialog, so in developer there is no Solution open (and hasn’t been since it was started)
- I start a Client and open a solution
- Click a button that executes a method that calls a plugin function
- The plugin makes a call to a Serverside function
- A NoClassDefFoundError error is thrown:
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
Looks to me the ServerSide of plugins is not initialized in plugins when starting Developer, without opening a solution.
Paul
Forgot:
Servoy Developer
Version R2 2.2.4-build 336
Java version 1.5.0_06-b05 (Windows 2000)
Servoy Client
Java Web Start 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot™ Client VM
Paul
More testing, trying etc. brought me to the conclusion that what I stated previously isn’t true: It not only happens with a Client with Developer as Server, without having opened a Solution in Developer since it was started.
I tried it by starting the Servoy Application Server and then starting a client, but I run into the same thing. Here’s the error that appears in the Java Console of the Client:
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.ExceptionInInitializerError
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.ExceptionInInitializerError
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at com.kydome.plugins.WebServices.Server_Stub.invokeWSServer(Unknown Source)
at com.kydome.plugins.WebServices.ClientProvider.js_DynInvokeServerside(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:347)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.gen.c16.call(activate:32)
at com.servoy.j2db.scripting.f.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at org.apache.axis.wsdl.gen.NoopFactory$1.(NoopFactory.java:136)
at org.apache.axis.wsdl.gen.NoopFactory.getBaseTypeMapping(NoopFactory.java:134)
at org.apache.axis.wsdl.gen.Parser.run(Parser.java:297)
at com.kydome.plugins.WebServices.DynamicInvoker.(Unknown Source)
at com.kydome.plugins.WebServices.DynamicInvoker.invoke(Unknown Source)
at com.kydome.plugins.WebServices.Server.invokeWSServer(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1542c06 for org.apache.commons.logging.impl.Log4JLogger
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37)
at org.apache.axis.encoding.TypeMappingImpl.(TypeMappingImpl.java:77)
… 17 more
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1542c06 for org.apache.commons.logging.impl.Log4JLogger
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:432)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
… 21 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.getConstructor(Class.java:1629)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:429)
… 22 more
Error: java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.ExceptionInInitializerError
Does it make any sense to someone? As I said: when I have Developer running as Application Server and I open the solution in Developer, the solution works fine in Developer. When I then start a Client, that also works fine.
But when I run Servoy Application Server, or Developer as Application Server without opening the Solution in Developer and then I start a Client, the execution of my method in the Client fails everytime.
After the method has failed in a Client, opening the Solution in Developer doesn’t resolve the problem anymore. Then even the Solution in Developer doesn’t work anymore in that case.
I ran the Developer with stacktrace on, but no clue’s there…
Any help appreciated, since I have to get this version into production asap…
Note: the Plugin function that makes a ServerSide call is my homegrown WebService plugin, that depends on external libraries. Since I see a NoClassDefFoundError error, I tried setting the loading of the external libraries to “eager” (see JNLP below), but to no avail.
<?xml version="1.0" encoding="utf-8"?>
Servoy Client Plugins
Servoy and Others
Paul
And to narrow it down even further: The situation in which is does work is the following:
- Developer as Application Server
- The solution opened in Developer
- The method that calls the plugin that makes the Server Side call has been invoked in the open Solution in Developer, before the Method is invoked in a Client
So, this means that it doesn’t matter if the solution was opened earlier in developer than in a Client. the only important thing is that the method that calls to the pluginfunction with the ServerSide calls is invoked in Developer BEFORE it’s invoked in a Client.
So, this leads me to believe, also based on the errors in the Java Console of the Client that somehow, only Developer is able to initialize the ServerSide of the plugin I made. And I have no clue how this could be…
Anyone any ideas?
Paul
it looks like a library problem on the serverside. You miss there a jar.
like something logging needs.
Johan,
I added the JAR that seems to cause the error to the ClassPath when starting the Server and that seems to solve the problem.
BUT: I thought all dependancies on external libraries for plugin’s were supposed to be dealt with though creating a JNLP file for the plugin in question. Has that changed?
Also: this doesn’t explain why it does work when I first execute the method in a solution opened in developer and only after that in Client and why it doesn’t work when I execute the method in a Client first…
Paul
As Johan explained offline, the JNLP files only take care of loading external libraries for Clinet Side use. If you require external libraries on the Server side, you need to place them in the ClassPath of the Server.
That clears is all up for me.
tnx Johan,
Paul