on 11-03-2009 8:55 AM
Hi friends,
In SAP MI 7.1 I have Successfully done the following steps:-
1. Created and build the service.
2. Created and build the UI.
3. Created and Build the application.
as per the tutorial available in the link
http://help.sap.com/saphelp_nwmobile71/helpdata/en/45/e5f99c6f472e98e10000000a155369/frameset.htm
After deploying , When I am trying to run the mobile application . I am getting the below shown error.
java.lang.IllegalStateException: com/sap/sdb/minDB/DriverEmbeddedMinDB (Unsupported major.minor version 48.0)
at com.sap.tc.mobile.cfs.compat.Context.getPersistenceManager(Context.java:41)
at com.sap.tc.mobile.cfs.compat.Context.getPersistenceManager(Context.java:28)
at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:76)
at java.lang.reflect.Method.invoke(Native Method)
at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)
Error starting the framework
java.lang.reflect.InvocationTargetException: java.lang.IllegalStateException: Cannot initialize framework
at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:146)
at java.lang.reflect.Method.invoke(Native Method)
at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)
Also in the Netweaver prefrences /Mobile/handhelds/runtime settings/ when I click on launch simulator . It gives the same error.
Please Suggest.
Regards
Nitesh.
The issue is usually related to compiling java code and running on an incompatible JVM version.
Are you building with the Compiler compliance at 1.4?
I have that problem myself when deploying to handheld that runs with CrEme, I had to go to NWDS preferences, expand Java, expand Compiler and set it to 1.4, by default sometimes it goes to 5.0 or 6.0
However, I am surprised it does not work with the simulator. is the JVM you are running on older than the JDK you are compiling with?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<br>Thanks a lot Alen . The reply was usefull. <br><br>
Now after deploying when I am running the application in mobile handheld Simulator . It gives the below shown exception<br><br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionLocalizeHelper:) Thread: main Error: <br>Resourcebundle sap.comtcmobilewdlitecontainer could not be found. Trying to use the default bundle.<br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.cfs.pers.PersistenceManager:release resultset) Thread: Finalizer Error: <br>java.sql.SQLException: Result set is closed<br>
2009-11-04 13:39:40 ... Thread: main Error: Internal Error. Please check the log file. --> <br> 2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionHandler:) Thread: main Error: Internal <br>Error. Please check the log file.<br> 2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionLocalizeHelper:) Thread: main Error: <br>Resourcebundle sap.comtcmobilewdlitecontainer could not be found. Trying to use the default bundle.<br> 2009-11-04 13:39:40 ... Thread: main Error: Internal Error. Please check the log file. --> <br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionHandler:) Thread: main Error: Internal <br>Error. Please check the log file.<br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionLocalizeHelper:) Thread: main Error: <br>Resourcebundle sap.comtcmobilewdlitecontainer could not be found. Trying to use the default bundle.
java.lang.NullPointerException<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:77)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:85)<br>
at com.sap.tc.mobile.wdlite.container.AppMenuView.startApp(AppMenuView.java:561)<br>
at com.sap.tc.mobile.wdlite.container.AppMenuView.onActionLaunchApp(AppMenuView.java:325)<br>
at com.sap.tc.mobile.wdlite.container.AppMenuView.invokeEventHandler(AppMenuView.java:368)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.AbstractViewElement.doHandleEvent(AbstractViewElement.java:199)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIElement.doHandleEvent(UIElement.java:353)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIImageButton.mouseReleased(UIImageButton.java:152)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIElement.dispatchMouseReleasedWidgetEvent(UIElement.java:396)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIElement$1.mouseReleased(UIElement.java:439)<br>
at com.sap.tc.mobile.wdlite.renderer.swt.MouseEventDispatcher.mouseUp(SWTControl.java:372)<br>
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137)<br>
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)<br>
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)<br>
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)<br>
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)<br>
at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:129)<br>
at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:231)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:24)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:176)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:19)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.setCurrentApplication(WDLite.java:148)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:80)<br>
at com.sap.tc.mobile.wdlite.framework.ApplicationLauncher.start(ApplicationLauncher.java:101)<br>
at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:576)<br>
at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:600)<br>
at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:637)<br>
at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:261)<br>
at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:139)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:324)<br>
at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)<br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionLocalizeHelper:) Thread: main Error: <br>Resourcebundle sap.comtcmobilewdlitecontainer could not be found. Trying to use the default bundle.<br>
2009-11-04 13:39:40 ... Thread: main Error: Application launch failed. --> <br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionHandler:) Thread: main Error: Application <br>launch failed.<br>
2009-11-04 13:39:40 ... (com.sap.tc.mobile.wdlite.renderer.exception.OCAExceptionLocalizeHelper:) Thread: main Error: <br>Resourcebundle sap.comtcmobilewdlitecontainer could not be found. Trying to use the default bundle.<br>
java.lang.ClassCastException<br>
at com.sap.demo.order_sv.service.impl.OrderService.generateTestData(OrderService.java:52)<br>
at com.sap.orderapp.comp.OrderComp.generateTestData(OrderComp.java:175)<br>
at com.sap.orderapp.comp.OrderComp.wdDoInit(OrderComp.java:73)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Controller.enter(Controller.java:21)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Component.enter(Component.java:24)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrentComponent(Application.java:125)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:155)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:19)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.setCurrentApplication(WDLite.java:148)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:80)<br>
at com.sap.tc.mobile.wdlite.container.AppMenuView.startApp(AppMenuView.java:561)<br>
at com.sap.tc.mobile.wdlite.container.AppMenuView.onActionLaunchApp(AppMenuView.java:325)<br>
at com.sap.tc.mobile.wdlite.container.AppMenuView.invokeEventHandler(AppMenuView.java:368)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.AbstractViewElement.doHandleEvent(AbstractViewElement.java:199)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIElement.doHandleEvent(UIElement.java:353)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIImageButton.mouseReleased(UIImageButton.java:152)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIElement.dispatchMouseReleasedWidgetEvent(UIElement.java:396)<br>
at com.sap.tc.mobile.wdlite.renderer.api.UIElement$1.mouseReleased(UIElement.java:439)<br>
at com.sap.tc.mobile.wdlite.renderer.swt.MouseEventDispatcher.mouseUp(SWTControl.java:372)<br>
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137)<br>
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)<br>
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)<br>
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)<br>
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)<br>
at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:129)<br>
at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:231)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:24)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:176)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:19)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.setCurrentApplication(WDLite.java:148)<br>
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:80)<br>
at com.sap.tc.mobile.wdlite.framework.ApplicationLauncher.start(ApplicationLauncher.java:101)<br>
at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:576)<br>
at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:600)<br>
at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:637)<br>
at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:261)<br>
at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:139)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:324)<br>
at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)<br>
Please Suggest<br>
<br>
<br>
It will be a great help.<br>
Regards
Nitesh.
Edited by: Nitesh Harit on Nov 4, 2009 2:22 PM
I think you got to resolve the error
java.lang.ClassCastException
I am not sure what could be causing it without seeing the actual code
at com.sap.demo.order_sv.service.impl.OrderService.generateTestData(OrderService.java:52)
perhaps if you are doing some Casting, provide the fully qualified name
something like... i'm just guessing here....
(com.sap.demo.order_sv.impl.Order) variable_name = (com.sap.demo.order_sv.impl.Order) get_object_code();
If you just put
(Order) Variable = (Order) get_object_code();
if you are importing packages or classes that share Order class as name, there can be a mixup, that is what i have experienced
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply Alen.
The program code I have pasted below .Please go through it and let me know if any code changes are rerquired.
package com.sap.orderapp.comp;
public void wdDoInit() {
//@@begin wdDoInit()
//$$begin (Mobile Service Component)
this.generateTestData();
wdContext.nodeorder_sv().nodegetOrderByLongText().bind(Collections.singleton(getOrderByLongText));
wdContext.nodeorder_sv().nodegetOrderByLongText().reload();
//$$end
//@@end
//----
// User-defined methods.
//----
Method generateTestData.
*/
public void generateTestData() {
//@@begin generateTestData()
//$$begin (Mobile Service Component)
((Order_svModel)OcaRoot.getInstance().getModel(Order_svModel.class)).getServiceOrderService().generateTestData();
//$$end
//@@end
}
Order Service. Java
package com.sap.demo.order_sv.service.impl;
public void generateTestData() {
//@@begin implementation
if( !(((Order_svModel)OcaRoot.getInstance().getModel(Order_svModel.class)).getOrderOrderheaders().size() > 0))
{
OrderOrderheader order = ((Order_svModel)OcaRoot.getInstance().getModel(Order_svModel.class)).createOrderOrderheader();
order.setOrderid("0023378");
order.setLongtext("Repair front door");
order.setServiceunit("SU01");
Date d1 = new Date(2007-06-30);
order.setCreatedOn((java.sql.Date) d1);
order.setCreatedAt(Time.valueOf("08:45:00"));
order = ((Order_svModel)OcaRoot.getInstance().getModel(Order_svModel.class)).createOrderOrderheader();
OcaRoot.getInstance().commit();
}
//@@end
Also When I am trying to debug after placing breakpoint at public void wdDoInit . the de-bugger says source not found.
The Mobile simulator appears with application but the data which I am creating using set methods in generateTestData() is not appearing .I think compiler is unablet to find generateTestData().
Please Suggest.
Regards
Nitesh.
Can you tell which is line 52 of OrderService where the code is failing?
I think it has to do with these type of lines,
if( !(((Order_svModel)OcaRoot.getInstance().getModel(Order_svModel.class)).getOrderOrderheaders().size() > 0))
I'm not an expert but I found that in my experience, if I did not split up the code, it would give java errors, and i'm trying to remember maybe it was ClassCast exceptions
We did our code like this, it might be better if you need to refer to the data model many times anyways, it'll make the code easier to read for subsequent programmer.
Order_svModel ordermodel = (Order_svModel)OcaRoot.getInstance().getModel(Order_svModel.class);
if(ordermodel.getOrderOrderheaders().size()>0)
or
OrderOrderheader order = ordermodel.createOrderOrderheader();
are there any imports that end with same java class name?
In NWDS if you mouseover (Order_svModel), it should tell you what class you are casting, make sure both sides of assignment are the same.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.