This discussion is archived
13 Replies Latest reply: Mar 1, 2009 3:51 AM by 843849 RSS

J9 CDC/Foundation WebServices

843849 Newbie
Currently Being Moderated
I have developed a test application using IBM J9 on a PocketPC platform. I am using the CDC/Foundation profile inconjuction with SWT and Web Services. I have gotten the SWT to work but when I call a web service I get class not found exception....sun.io.CharToByteConverter. Since the documentation for j9 for the PPC platform is very limited (especially for Foundation profile) I believe I may not have copied over the necessary dll's and/or zip files. Does anyone know how I might alleviate this problem? Which file do I need to copy over? or which zip file I need to include in the class path.

Enviroment is:
WSDD 5.0 (CDC/Foundation/SWT)
WebLogic 8.1 webservices client
currently using Hitachi G1000 as deployment platform (will be changing to a more robust/powerful aka more memory handheld)

Thanks
- Doug
  • 1. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    You must be including an jar which contains hard references to Sun's character converter classes. J9 is a cleanroom JVM and contains no Sun source. If the application you are running hard references an implementation class (those that start with com.sun.*) then it's not a very portable application.
  • 2. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Further, if you look at the entire stack trace (or post it) that will show perhaps the place where the code is referenced.
  • 3. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Here is the stack trace that I get when executing the application...

    javax.xml.rpc.soap.SOAPFaultException: Exception during processing:
    java.lang.NoClassDefFoundError: sun.io.CharToByteConverter (see Fault Detail for stacktrace)
    at java.lang.Throwable.<init>(Unknown Source)
    at java.lang.Throwable.<init>(Unknown Source)
    at javax.xml.rpc.soap.SOAPFaultException.<init>(Unknown Source)
    at weblogic.webservice.core.ClientDispatcher.receive(Unknown Source)
    at weblogic.webservice.core.ClientDispatcher.dispatch(Unknown Source)
    at weblogic.webservice.core.DefaultOperation.invoke(Unknown Source)
    at weblogic.webservice.core.DefaultOperation.invoke(Unknown Source)
    at weblogic.webservice.core.rpc.StubImpl._invoke(Unknown Source)
    at testApp.ws.WSLoginMgrPort_Stub.login(Unknown Source)
    at testApp.ui.swt.LoginPanel.widgetSelected(Unknown Source)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at testApp.ui.swt.MainApp.run(Unknown Source)
    at testApp.ui.swt.MainApp.main(Unknown Source)

    Any thoughts with this information?
  • 4. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Here are the dlls that I have installed on my WinCE device:

    iverel21.dll
    j9cdc21.dll
    j9cldc21.dll
    j9core21.dll
    j9dyn21.dll
    j9found21.dll
    j9gc21.dll
    j9prt21.dll
    j9rt21.dll
    j9thr21.dll
    j9vm21.dll
    j9zlib21.dll

    The are located in /WSDD/bin

    My /WSDD/lib directory contains:
    charconv.zip
    jclFoundation.jxeLinkOptions
    maps.zip
    security.policy
    jclFoundation/classes.zip
    jclFoundation/ivemsp.jar
    jclFoundation/locale.zip
    jclFoundation/maps.zip
    jclFoundation/profile.jar
    jclFoundation/rmip.zip

    I think I don't have my WinCE device properly configured for Foundation profile. Is there something I am missing?

    Thanks
    - Doug
  • 5. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Here is my lnk file

    255#\WSDD\bin\j9foun.exe -Djava.library.path=\testApp\lib -cp \testApp\testApp-swt-ppc.jar testApp.ui.swt.MainApp
  • 6. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    j9cdc21.dll, j9cldc21.dll, j9core21.dll, j9rt21.dll

    These DLL's are for CDC, CLDC, CORE and Realtime (both custom libraries).

    You don't need these DLL's for Foundation.
  • 7. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Right, back to the stacktrace problem. So what I'm suggesting is that javax.xml.rpc.soap.SOAPFaultException has a reference to a non-spec'ed class. To verify that, you could use javap.exe from your JDK to decompile it. You need the jar that this Exception can be found it, then run javap like:

    javap - classpath thejar.jar -c javax.xml.rpc.soap.SOAPFaultException

    look in the results for a reference to sun.io.CharToByteConverter. If there is one, who ever wrote that code wrote it bogusly.
  • 8. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    You are so right. Thanks for help. I should have looked at the API for SOAPFaultException to get more information...when I did...this is what I found:

    Detail: <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.NoClassDefFoundError: sun.io.CharToByteConverter

    at java.lang.Throwable.<init&gt
    at java.lang.Throwable.<init&gt
    at java.lang.NoClassDefFoundError.<init&gt at weblogic.utils.io.NoFlushOutputStreamWriter.<clinit&gt
    at java.lang.Class.initializeImpl(Native Method)
    at java.lang.Class.initialize
    at weblogic.webservice.core.soap.SOAPPartImpl.writeTo
    at weblogic.webservice.core.soap.SOAPMessageImpl.writeTo
    at weblogic.webservice.binding.http11.Http11ClientBinding.send
    at weblogic.webservice.core.handler.ClientHandler.handleRequest
    at weblogic.webservice.core.HandlerChainImpl.handleRequest
    at weblogic.webservice.core.ClientDispatcher.send
    at weblogic.webservice.core.ClientDispatcher.dispatch
    at weblogic.webservice.core.DefaultOperation.invoke
    at weblogic.webservice.core.DefaultOperation.invoke
    at weblogic.webservice.core.rpc.StubImpl._invoke
    at testApp.ws.MyServicePort_Stub.helloWorld
    at testApp.ui.swt.LoginPanel.widgetSelected
    at org.eclipse.swt.widgets.TypedListener.handleEvent
    at org.eclipse.swt.widgets.EventTable.sendEvent
    at org.eclipse.swt.widgets.Widget.sendEvent
    at org.eclipse.swt.widgets.Display.runDeferredEvents
    at org.eclipse.swt.widgets.Display.readAndDispatch
    at testApp.ui.swt.MainApp.run(Unknown Source)
    at testApp.ui.swt.MainApp.main(Unknown Source)
    </bea_fault:stacktrace>
    </detail>


    As can be seen there is a reference to sun.io.CharToByteConverter which is verified by j
    avap -jar webserviceclient.jar -c weblogic.utils.io.NoFlushOutputStreamWriter

    Thanks again for the help!

    - Doug
  • 9. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Sounds like you should report a bug! Use of vendor specific classes is a no-no.
  • 10. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Hi,

    I was going through this thread, and I also want to ask something because I am also facing some similar type of issue. The scenario is as follows:

    I want to use ScrolledComposite class in my application. If I am running the application using jclDesktop jre, no problem comes, but when I run the application using jclDevice jre, I get the following error at runtime:

    java.lang.NoClassDefFoundError: org.eclipse.swt.custom.ScrolledComposite
         at java.lang.J9VMInternals.verifyImpl(Native Method)
         at java.lang.J9VMInternals.verify(J9VMInternals.java:86)
         at java.lang.J9VMInternals.initialize(J9VMInternals.java:147)
         at java.lang.Class.newInstanceImpl(Native Method)
         at java.lang.Class.newInstance(Class.java:1247)
         at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:157)
         at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
         at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
         at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
         at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Unknown Source)
         at org.eclipse.ui.internal.registry.ViewDescriptor.createView(Unknown Source)
         at org.eclipse.ui.internal.ViewFactory.busyRestoreViewHelper(Unknown Source)
         at org.eclipse.ui.internal.ViewFactory.busyRestoreView(Unknown Source)
         at org.eclipse.ui.internal.ViewFactory.restoreView(Unknown Source)
         at org.eclipse.ui.internal.Perspective.showView(Unknown Source)
         at org.eclipse.ui.internal.WorkbenchPage.busyShowView(Unknown Source)
         at org.eclipse.ui.internal.WorkbenchPage.showView(Unknown Source)
         at org.eclipse.ui.internal.WorkbenchPage.showView(Unknown Source)
         at com.ibm.lotusphere.rcp.LoginPage.widgetSelected(LoginPage.java:84)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
         at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:476)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1550)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1405)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
         at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
         at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
         at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:203)
         at java.lang.reflect.Method.invoke(Method.java:252)
         at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source)
         at org.eclipse.core.launcher.Main.basicRun(Unknown Source)
         at org.eclipse.core.launcher.Main.run(Unknown Source)
         at org.eclipse.core.launcher.Main.main(Unknown Source)
    org.eclipse.swt.custom.ScrolledComposite

    I understand that swt.jar is not recognized by jclDevice...... and to do that I have to put few dlls and jars on few locations. Now the question is wht will be the locations?

    I am using eclipse 3.2.2 version.

    I tried out putting dlls and jars in System32 and classpath respectively. I did not work. Then I put the dlls and jars in eclipse/plugins/.....jclDevice...../jre/lib. It also did not work.

    Please suggest what should I do?
    Any feedback could be helpful.

    Waiting for responses......

    thanks and regards

    Saurabh
  • 11. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    j9 machine will support the jdk1.3. in jdk1.4, you cannot generate the webservice.

    i am also using this same. you need to create soap request and pass to the web service client and receive the soap response message via outputstream and inputstream respectively....
  • 12. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    Hi Saurabh and all others,

    I am also facing similar problems with the use of the jclDevice runtime. During runtime I get the following error:

    java.lang.NoClassDefFoundError: java.awt.Window
         at java.lang.J9VMInternals.verifyImpl(Native Method)
         at java.lang.J9VMInternals.verify(J9VMInternals.java:63)
         at java.lang.J9VMInternals.initialize(J9VMInternals.java:124)
         at mobile.coaching.InvokeNative.init(InvokeNative.java:31)
         at mobile.coaching.UI$4.widgetSelected(UI.java:187)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
         at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:475)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1382)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
         at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
         at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
         at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
         at java.lang.reflect.Method.invoke(Method.java:278)
         at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source)
         at org.eclipse.core.launcher.Main.basicRun(Unknown Source)
         at org.eclipse.core.launcher.Main.run(Unknown Source)
         at org.eclipse.core.launcher.Main.main(Unknown Source)
    Unhandled event loop exception
    Reason:
    java.lang.NoClassDefFoundError: java.awt.Window
         at java.lang.J9VMInternals.verifyImpl(Native Method)
         at java.lang.J9VMInternals.verify(J9VMInternals.java:63)
         at java.lang.J9VMInternals.initialize(J9VMInternals.java:124)
         at mobile.coaching.InvokeNative.init(InvokeNative.java:31)
         at mobile.coaching.UI$4.widgetSelected(UI.java:187)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
         at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:475)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1382)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
         at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
         at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
         at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
         at java.lang.reflect.Method.invoke(Method.java:278)
         at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source)
         at org.eclipse.core.launcher.Main.basicRun(Unknown Source)
         at org.eclipse.core.launcher.Main.run(Unknown Source)
         at org.eclipse.core.launcher.Main.main(Unknown Source)
    java.awt.Window

    This happens when I try to load a jar-file (jna.jar for native library calls) which imports some java.awt classes (like java.awt.Window). Is there a way to use the java.awt and java.swt packages or at least some of the classes that I need?
  • 13. Re: J9 CDC/Foundation WebServices
    843849 Newbie
    Currently Being Moderated
    If you want AWT, then you need Personal Profile, there is no AWT in CDC/Foundation. But maybe you have it, you should try -jcl:ppro11