3 Replies Latest reply on Aug 25, 2006 11:33 PM by Ales Justin

    JBoss AS started as Windows service & Spring deployer

    Miroslav Lazarevic Newbie

      It's seems there is some bug in Spring deployer when JBoss is started as Windows native service. When JBoss server is started from console then everything works fine. But after it started as service my client application gets next exception.

      java.lang.reflect.UndeclaredThrowableException
      at $Proxy0.getAllPreduzeca(Unknown Source)
      at com.birosoft.workday.platform.intro.ClientWizardPage.updatePreduzeceList(ClientWizardPage.java:144)
      at com.birosoft.workday.platform.intro.ClientWizardPage.createControl(ClientWizardPage.java:138)
      at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:180)
      at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:614)
      at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:502)
      at org.eclipse.jface.window.Window.create(Window.java:426)
      at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1124)
      at org.eclipse.jface.window.Window.open(Window.java:785)
      at com.birosoft.workday.platform.intro.Application.login(Application.java:68)
      at com.birosoft.workday.platform.intro.Application.run(Application.java:32)
      at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
      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 org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
      at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
      at org.eclipse.core.launcher.Main.run(Main.java:977)
      at org.eclipse.core.launcher.Main.main(Main.java:952)
      Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.CannotGetJdbcConnectionException
      at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:98)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
      at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
      at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
      at org.jboss.remoting.Client.invoke(Client.java:525)
      at org.jboss.remoting.Client.invoke(Client.java:488)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
      ... 24 more

      Part of my jboss-spring.xml:

       <bean id="dataSource"
       class="org.springframework.jdbc.datasource.DriverManagerDataSource">
       <property name="driverClassName">
       <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
       </property>
       <property name="url">
       <value>jdbc:odbc:profittest</value>
       </property>
       <property name="username">
       <value></value>
       </property>
       <property name="password">
       <value></value>
       </property>
       </bean>
       <bean id="jdbcTemplate"
       class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate">
       <constructor-arg>
       <ref bean="dataSource" />
       </constructor-arg>
       </bean>
       <bean id="preduzeceDao"
       class="com.birosoft.server.profit.preduzece.PreduzeceDaoJdbc">
       <property name="jdbcTemplate">
       <ref bean="jdbcTemplate" />
       </property>
       </bean>
      


      When I made Spring library available to my client, I found out that problem was in creating dataSource bean. Spring deployer was not able to properly create it, because it complains that can't find url and jdbc driver. I think when JBoss is started as service then Spring deployer was not able to read jboss-spring.xml file.