cancel
Showing results for 
Search instead for 
Did you mean: 

MDK plugin broken

Former Member
0 Kudos

Dear all,

This week I was trying out the new NetWeaver Developer Studio 7.1 with the Mobile plugin. I hoped this would work to further develop our MAM 2.5, but unfortunately I was not able to compile the JSP files and to run the MAM application from within NetWeaver Developer.

So I did start using the old NetWeaver Developer Studio 7.0 again (based on Eclipse 2.1.2).

Unfortunately, I did notice that the MDK plugin seemed to be broken: the data that I did give in in the MDK preferences window were gone, and the boxes to fill in the user name and password (to start up the MAM from within NetWeaver Developer) were gone as well, together with the buttons in that screen. Because of this, I was not able any longer to export the compiled MAM code or to run the MAM application from within NetWeaver Developer.

I thought it was maybe because both Developer Studios (7.0 and 7.1) were maybe using the same workspace or something, so I did remove both of them, and did re-install SAP NetWeaver Developer Studio 7.0. Unfortunately it still didn't work.

So I removed the Mobile Infrastructure, the Java SDK and JRE's and the NetWeaver Developer Studio, and re-installed all of them. But again the same problem.

I did download Eclipse 2.1.3 and did copy the MDK eclipse plugin to this Eclipse version, but also then exactly the same problem!

You can find a screenshot here: [Wrong MDK preferences screen|http://picasaweb.google.com/diederik.v.w/MAMMDKProblem/photo#5229547486802889586]

Now the strange thing is that when I copy this "faulty" Eclipse folder on the laptop of my colleague, it is working as it should, and it shows the preferences screen correctly. This is why I conclude that it should be some system environment setting. However I have no idea what system environment setting is used by the MDK plugin. I've checked my JAVA_HOME variable and my path variable, but both seems to be OK. I've tried to disable all the non-microsoft services, but the problem still occurs.

Can someone give me some advice? It is blocking all my developments at the moment and I am already looking for 2 days how to solve this issue...

Thanks in advance!

Best regards,

Diederik Van Wassenhove

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I have seen this behaviour as well - and unfortunately was not really able to solve it at the end. So because I thought Eclipse 3 is the better option anyway, I had a look on how I could live without MDK. It is a nice tool, but as long as it is not working properly in Eclipse 3 - well, there is nothing more frustrating then switching Eclipse for simple build stuff and then switch again for JSP syntax checking and developing. So I had a look here in SDN and - if you search you find....

Have a look here:

Both blogs do not really solve your issue, but they show you how to do the steps manually. Beside that I am able to build MI files directly into the MI WEBAPPS folder and so I can change files on the fly and safe even more time.

Perhaps this is an option for you as well.

Regards,

Oliver

Former Member
0 Kudos

Hi Oliver,

Thanks a lot for your answer and tips!

I can't understand how it is possible that SAP releases such a software that is screwing up your (old) development environment!

I did now make my own ANT build file which compiles everything and which puts everything in a WAR file. I'll put it at the end of this message just for those who are interested. In fact, it is much more flexible then the MDK plugin, but the drawback is of course that it is hard to make a good ANT file that is fulfilling your needs. Also debugging is not optimal yet. I am still looking how to do the following things:

a) I want to start up my webbrowser automatically when launching my run target. Now I have to launch my run target, and then open my webbrowser separately. If I can make this automated (opening the webbrowser on the right address after the code is running), it would be almost perfect!

b) I currently can not debug my JSPs. Is there anyone who knows how to debug my JSPs? If it is not possible directly, is it possible to debug them by using the generated JAVA files from the JSPs?

If someone can help me with that, it would be the perfect alternative for the MDK plugin!

Best regards and thanks in advance!

Diederik

Edited by: Diederik Van Wassenhove on Aug 5, 2008 5:08 PM

Edited by: Diederik Van Wassenhove on Aug 5, 2008 5:09 PM

Former Member
0 Kudos

<!-- ANT build file: -->

<!-- Remarks:

Libs needed by this ANT file to compile everything correctly are added separately in the builder classpath of this build file; without these libs the build file will not work.

This build file works for our MAM structure, you'll have to adapt it to your own structure.

The classes themselves are compiled before via the standard Java Builder in Eclipse. -->

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!-- Author: Diederik Van Wassenhove -->

<project name="builder" default="jspCompile" basedir=".">

<!-- folder to store the generated java files -->

<property name="gen.jsp.dir" value="$jsp" />

<!-- folder to store the final build (war file and jar file) -->

<property name="build.dir" value="build" />

<!-- folder where the jsp files are located -->

<property name="prj.jsp.dir" value="app-root" />

<!-- folder where the compiled JAVA classes are stored -->

<!-- remark: java classes are compiled by standard builder -->

<property name="prj.class.dir" value="bin" />

<!-- jar and war file to create -->

<property name="jar.name" value="mam25.jar" />

<property name="war.archive.pc" value="MAM25.war" />

<!-- optional: file name to write the current build date and time -->

<property name="build.date" value="${build.dir}/buildDate.txt" />

<!-- compilation settings -->

<property name="target.version" value="1.4" />

<property name="deprecate.flag" value="on" />

<!-- file names -->

<property name="web.xml" value="web.xml" />

<property name="web.inc" value="webinc.xml" />

<property name="web.org" value="weborg.xml" />

<property name="filter.token" value="WEBINC" />

<!-- target: jspCompile which is set as default -->

<target name="jspCompile">

<!-- Clean up everything and make folder structures -->

<mkdir dir="${gen.jsp.dir}" />

<delete includeemptydirs="true">

<fileset dir="${gen.jsp.dir}" includes="**/*" />

</delete>

<mkdir dir="${build.dir}" />

<delete includeemptydirs="true">

<fileset dir="${build.dir}" includes="**/*" />

</delete>

<delete includeemptydirs="true">

<fileset dir="${prj.class.dir}">

<include name="**/*" />

<exclude name="com/**" />

<exclude name="**/*.properties"/>

</fileset>

</delete>

<!-- optional: execute the date command and put the output into the buildDate.txt -->

<exec dir="." executable="cmd.exe">

<arg line="/c date /T > ./${build.date}"/>

</exec>

<exec dir="." executable="cmd.exe">

<arg line="/c time /T >> ./${build.date}"/>

</exec>

<!-- call the jspc for jsp to java translation -->

<jspc webinc="${gen.jsp.dir}\${web.inc}" verbose="2" srcdir="${prj.jsp.dir}" destdir="${gen.jsp.dir}" >

<webapp basedir="${prj.jsp.dir}" />

</jspc>

<!-- compile the jsps java files -->

<javac target="${target.version}" srcdir="${gen.jsp.dir}" destdir="${prj.class.dir}" deprecation="${deprecate.flag}" />

<!-- merge the webinc.xml into the original web.xml with WEBINC token -->

<loadfile property="${web.inc}" srcFile="${gen.jsp.dir}\${web.inc}"/>

<copy file="${web.org}" toFile="${prj.class.dir}/${web.xml}">

<filterset>

<filter token="${filter.token}" value="${webinc.xml}" />

</filterset>

</copy>

<!-- create jar for Java files, we exclude the compiled JSP classes here -->

<jar jarfile="${build.dir}/${jar.name}" >

<fileset dir="${prj.class.dir}">

<include name="com/**" />

<include name="**/*.properties"/>

</fileset>

</jar>

<!-- Create the precompiled war archive and put the compiled JSPs into the WEB-INF/classes -->

<war destfile="${build.dir}/${war.archive.pc}" webxml="${prj.class.dir}/${web.xml}">

<zipfileset dir="${prj.jsp.dir}">

<exclude name="*/.jsp" />

<exclude name="**/web.xml" />

<exclude name="*/CVS*" />

<exclude name="*/META-INF*" />

</zipfileset>

<zipfileset file="${build.date}" />

<classes dir="${prj.class.dir}" />

</war>

</target>

</project>

Edited by: Diederik Van Wassenhove on Aug 5, 2008 5:10 PM

Former Member
0 Kudos

Hi,

sorry, had no acces the last days...

Well, first question is: why can you not debug your JSPs? This was not possible with MDK - only using the comiled $JSP classes was possible. This is more or less still the case.

Why is it an issue to open the Browser? Well, I had something in the startup a while back insoide Eclipse - but I am not sure about it any longer cause anyway I loved it to open a separate browser and test it in different versions. So my question is: why can you not debug your generated JSPs?

Regards,

Oliver

Former Member
0 Kudos

Hi Oliver,

The problem with the webbrowser I could tackle already. I did make a separate file to launch first the framework and then launch a webbrowser with hostname http://localhost:4444. You can find the code below.

However I don't know yet how to make use of the generated jsp java files (I store them also in a folder called $JSP, but is seems that they are not used during debugging). Can you tell me how to do this? Is it some kind of setting in your run-configuration?

Thanks in advance and best regards!

Diederik Van Wassenhove


package com.ibm.acc.mam.launch;

import java.io.IOException;

import com.sap.ip.me.core.FrameworkInitializer;

public class Launch
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		String [] arg = {"-home:C:\\Program Files\\SAP Mobile Infrastructure", "-trace", "-url:MAM25/start", "-app:jsp"};
		FrameworkInitializer.main(arg);
		openWebBrowser("iexplore", "http://localhost:4444");
	}
	
	private static void openWebBrowser(String webBrowser, String href)
	{
		System.out.println("Launching " + webBrowser + "...");
		webBrowser = webBrowser + " http://localhost:4444";

		try
		{
			Runtime.getRuntime().exec("cmd.exe /c start "+ webBrowser);
		}
		catch (IOException e)
		{
			System.out.println(webBrowser + " failed to launch!");
		}
	}

}