cancel
Showing results for 
Search instead for 
Did you mean: 

How to debug a MDK project

konchada_saikrishna
Active Participant
0 Kudos

Hi MI Experts,

I am new to SAP MI,

I was provided with a usecase to resolve in a MAM application.

I am having MAM25 application which is running fine in my MI client.

I imported this application into NWDS, now how to start debugging this application.

what all the parameters to be provided in the debug configuration especially Arguments and Main class tabs.

Thanks in advance.

Helping answer is rewarded.

Regards,

Sai.k.k

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

Look at my blog entry:

/people/community.user/blog/2007/02/14/how-to-set-up-nwds-or-eclipse-without-mdk

It expalins how to setup NWDS for mobile project without using MDK. Development and debugging is much faster after

Thank you,

Julien.

Former Member
0 Kudos

hi konchada,

regardless whether you are using NWDS or Eclipse without MDK, the debugging

procedure is the same. first you have to include the MI libraries into your project.

--> see <MI installation dir>\lib for the binaries

to debug, use the following programs and arguments.

1) use either the com.sap.ip.me.core.Startup or

com.sap.ip.me.core.FrameworkInitializer

- use Startup only if you want to load the lib jar files that are in the lib directory of

your MI client installation specified in the -home argument shown below.

- if you have the jar files included into your project, i would suggest to use the

FrameworkInitializer.

2) in the program arguments specify the following arguments.

<b>-home:"<MIclient installation dir>" -trace -logon:<username>:<localPwd></b>

-home is required. others like -trace (turn on the trace), -logon (auto user logon)

are optionals. there are more which you can use, but i guess these are those

that will be of convenient to you.

sample:

-home:"C:\Program Files\SAP\SAP Mobile Infrastructure" -trace -logon:jogel:mobi

hope this help.

regards

jo

Former Member
0 Kudos

Hi Konchasa,

Have you configured the MDK plugin?

If not then configure it first.

For that

1. Go to Menu Windows > Preferences

2. Go to MDK

3. Depending on what type of client(i.e. JSP or AWT) select the MI home folder

4. Provide the MI client user name & Password.

5. In NWDS, switch to debug perspetive.

5. Select MAM projeect from the list.

6. Go to Menu File > Export > MDK: Export project in to a MI archieve

7. Put the debug point and click on debug button to start

Go to Run menu> Debug... > Mi Application node

Select MAM application > Go to arguments tab and

add following in to the argumtns of MAM project

"-home:C:\Program Files\SAP Mobile Infrastructure" -trace -url:MAM/start -app:jsp

Thanks,

Abhijit

konchada_saikrishna
Active Participant
0 Kudos

Hi Abhijit,

my MDK plugin was already configured.

at that time it is used to give an error saying Userid and password are invalid

now I have done, the way u said again

now it is giving an exception.

Added com.sap.ip.me.core.ShutDownThread as a JVM ShutdownHook

-


Initialize framework ...

Configuration initialized. Installation Base = D\SAP Mobile Infrastructure

Path settings adjusted

Log file with name: "D\SAP Mobile Infrastructure\log\trace.txt" cannot be created.

java.io.FileNotFoundException: D\SAP Mobile Infrastructure\webapps\me\D\SAP Mobile Infrastructure\log\trace.txt (The system cannot find the path specified)

at java.io.FileOutputStream.openAppend(Native Method)

at java.io.FileOutputStream.<init>(FileOutputStream.java:177)

at java.io.FileOutputStream.<init>(FileOutputStream.java:102)

at com.sap.ip.me.api.logging.DefaultFileLogWriter.switchOn(DefaultFileLogWriter.java:516)

at com.sap.ip.me.api.logging.DefaultFileLogWriter.switchOn(DefaultFileLogWriter.java:278)

at com.sap.ip.me.api.logging.Trace.switchOn(Trace.java:123)

at com.sap.ip.me.api.logging.Trace.refresh(Trace.java:179)

at com.sap.ip.me.api.logging.Trace.<init>(Trace.java:76)

at com.sap.ip.me.api.logging.Trace.getInstance(Trace.java:90)

at com.sap.ip.me.api.conf.Localization.setTimeZone(Localization.java:96)

at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:343)

at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:124)

at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:128)

at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:41)

Timezone initialized; use timezone id 'Asia/Calcutta'

Log file with name: "D\SAP Mobile Infrastructure\log\applog.txt" cannot be created.

java.io.FileNotFoundException: D\SAP Mobile Infrastructure\webapps\me\D\SAP Mobile Infrastructure\log\applog.txt (The system cannot find the path specified)

at java.io.FileOutputStream.openAppend(Native Method)

at java.io.FileOutputStream.<init>(FileOutputStream.java:177)

at java.io.FileOutputStream.<init>(FileOutputStream.java:102)

at com.sap.ip.me.api.logging.DefaultFileLogWriter.switchOn(DefaultFileLogWriter.java:516)

at com.sap.ip.me.api.logging.DefaultFileLogWriter.switchOn(DefaultFileLogWriter.java:278)

at com.sap.ip.me.api.logging.AppLog.switchOn(AppLog.java:128)

at com.sap.ip.me.api.logging.AppLog.refresh(AppLog.java:497)

at com.sap.ip.me.api.logging.AppLog.<init>(AppLog.java:81)

at com.sap.ip.me.api.logging.AppLog.getInstance(AppLog.java:95)

at com.sap.ip.me.core.FrameworkInitializer.initTrace(FrameworkInitializer.java:511)

at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:346)

at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:124)

at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:128)

at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:41)

Trace initialized. Log is switched on.

java.lang.ExceptionInInitializerError

at com.sap.ip.me.core.FrameworkInitializer.initSingletons(FrameworkInitializer.java:912)

at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:349)

at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:124)

at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:128)

at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:41)

Caused by: java.lang.RuntimeException: Startup aborted because user manager cannot be instanitated!

at com.sap.ip.me.core.UserManagerImpl.<clinit>(UserManagerImpl.java:2421)

... 5 more

Thread[Thread-0,5,main] com.sap.ip.me.core.ShutDownThread activated

Calling CommunicationServer.doSmoothShutdown()

smooth shutdown will be performed

java.lang.ExceptionInInitializerError

at com.sap.ip.me.sync.SyncManagerImpl.<init>(SyncManagerImpl.java:127)

at com.sap.ip.me.sync.SyncManagerMerger.<init>(SyncManagerMerger.java:31)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

at java.lang.Class.newInstance0(Class.java:308)

at java.lang.Class.newInstance(Class.java:261)

at com.sap.ip.me.api.sync.SyncManager.<clinit>(SyncManager.java:237)

at com.sap.ip.me.core.CommunicationServer.doSmoothShutdown(CommunicationServer.java:227)

at com.sap.ip.me.core.ShutDownThread.run(ShutDownThread.java:24)

Caused by: com.sap.ip.me.api.conf.FactoryException: Exception while instantiating com.sap.ip.me.core.ConversationIdHandler

at com.sap.ip.me.api.conf.Configuration.createInstanceForType(Configuration.java:521)

at com.sap.ip.me.api.conf.Configuration.getSingletonInstanceForType(Configuration.java:457)

at com.sap.ip.me.core.ConversationIdHandler.<clinit>(ConversationIdHandler.java:725)

... 11 more

Regards,

Sai.k.k

Former Member
0 Kudos

hi konchada,

check on your MI installation path.

seems that you specified an incorrect path: <b>D\SAP Mobile Infrastructure</b>. check your settings in the MDK Preference.

it should be <b>D:\SAP Mobile Infrastructure</b> with the colon I gues...

regards

jo

Former Member
0 Kudos

Hi Konchada,

Please add following to the comman line argument

-home:"<your MI home directory path>" -trace -logon:<username>:<password> -url:<application name e.g. MAM>/start -app:jsp

-home:"C:\Program Files\SAP Mobile Infrastructure" -trace -logon:abhijit:abhi -url:HELLOWORLD/start -app:jsp

Thanks,

Abhijit

konchada_saikrishna
Active Participant
0 Kudos

Hi Jo,

You r right, I missed the colon there, after putting that the application is running fine.

I kept a break point in the code, but it is not halting at that position or any where.

what might be wrong/ do I need to do some thing for that.

Regards,

Sai.k.k

Former Member
0 Kudos

hi konchada,

which part of the code you set the break point?

if it is not halting on that codeline, then that codeline isn't executed it could be

branching the other way. try putting a breakpoint somewhere in the codeline

which is certainly be executed. from there you can step into or step over the code

lines till the portion which you wanted to check.

regards

jo

konchada_saikrishna
Active Participant
0 Kudos

Hi Jo,

I kept the break point in the JSP page which I am working on.

I remember one of my friend saying that, when ever we put a break point in the code, it looks as a circle in JSP page

and as a circle with a point on it in the Debug perspective.

I could not see any point on the circle.

how ever I kept the break point in the correct JSP ...

Regards,

Sai.k.k

Former Member
0 Kudos

hi konchada,

try adding the translated java codes of your jsp into the project. they are usually

located in the webapps folder. just take care of the logical paths...

regards

jo