cancel
Showing results for 
Search instead for 
Did you mean: 

Application Client Project

Former Member
0 Kudos

Hello All,

I tried creating an application client project as mentioned in the [example|http://help.sap.com/saphelp_nwce10/helpdata/en/45/80e5e656be0dece10000000a11466f/content.htm]. However, when I run it I get with the message: com.sap.engine.services.appclient.client.AppClientException: "Could not get runtime model for application with name:sap.com/TestEJBEAR".

Here's my build script.

<?xml version="1.0" encoding="UTF-8"?>
<project name="AppclientRunner" default="execute" basedir=".">
	<property name="engine.install.dir" value="C:/usr/sap" />
	<property name="SID" value="CE1" />
	<property name="JC_NUMBER" value="00" />
	<property name="USERNAME" value="Administrator" />
	<property name="PASSWORD" value="**********" />
	<property name="JNDI_FACTORY"
		value="com.sap.engine.services.jndi.InitialContextFactoryImpl" />
	<property name="PROVIDER_URL" value="CESERVER:5${JC_NUMBER}04" />
	<property name="EAR_PROJECT_NAME" value="sap.com/TestEJBEAR" />
	<path id="appclient.class.path">
		<pathelement path="${java.class.path}/" />
		<pathelement
			path="${engine.install.dir}/${SID}/JC${JC_NUMBER}/
              j2ee/j2eeclient/sap.com~tc~exception~impl.jar" />
		<pathelement
			path="${engine.install.dir}/${SID}/JC${JC_NUMBER}/
              j2ee/j2eeclient/sap.com~tc~logging~java~impl.jar" />
		<pathelement
			path="${engine.install.dir}/${SID}/JC${JC_NUMBER}/
              j2ee/j2eeclient/sap.com~tc~je~clientlib~impl.jar" />
		<pathelement
			path="${engine.install.dir}/${SID}/JC${JC_NUMBER}/
              j2ee/cluster/bin/ext/ejb_api/ejb-3_0-api.jar" />
		<pathelement location="TestEJBClient.jar" />
		<pathelement location="../TestEJB/TestEJB.jar" />
	</path>
	<target name="execute">
		<java
			classname="com.sap.engine.services.appclient.client.Launcher"
			fork="yes">
			<classpath refid="appclient.class.path" />
			<arg value="-U${USERNAME}" />
			<arg value="-P${PASSWORD}" />
			<arg value="-F${JNDI_FACTORY}" />
			<arg value="-H${PROVIDER_URL}" />
			<arg value="-name" />
			<arg value="${EAR_PROJECT_NAME}" />
		</java>
	</target>
</project>

Any pointers will be highly appreciated.

Best regards,

Bala

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Bala,

Please check if the application is deployed and started successfully.

Cheers,

Vladimir

Former Member
0 Kudos

Hello Vladimir,

Please check if the application is deployed and started successfully.

Thanks for the prompt response (as usual !). The application has been deployed successfully. In fact, I can see my EJB project (TestEJBEAR) available under the apps/sap.com/ folder in my server with the . TestEJBEAR\EJBContainers\applicationjars folder containing the suitable jar file.

But, how can I start my application..?

Thanks.

Bala

Vlado
Advisor
Advisor
0 Kudos

Hi Bala,

You can do that for example from NWA or Telnet.

In Telnet use the command

> start_app TestEJBEAR

You can also use the command

> list_el -a TestEJBEAR

to view the components of your app.

HTH!

\-- Vladimir

Former Member
0 Kudos

I've checked from NWA.. The application is started. Still I get the same error. I've done the following changes ..

1. Running the ANT script throws

"java.lang.NoClassDefFoundError: com/sap/engine/services/appclient/client/Launcher"

, So I've added the required four libraries ( mentioned in the xml file I've listed in this thread above ) in the classpath of the ANT run configuration.

2. The help [document |http://www.google.co.in/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fhelp.sap.com%2Fsaphelp_nwce711%2Fhelpdata%2Fen%2F45%2F804E0D77FE1956E10000000A11466F%2Fcontent.htm&ei=sB6JSdjzJ8PDkAXjvrSHCA&usg=AFQjCNEdcOJOBq6sOrLuJ8AN0w1k9hm4YQ&sig2=9zCCvNKnCxKs7NclT0U85Q] shows that the parameter engine.install.dir should point to NWDS plugins path .. but I think it should point to the server installation path ..

3. After adding the jars to the ANT run configuration classpath, when I execute the script, I get the error

Could not get runtime model for application with name: sap.com/TestEJBEAR

.

Any pointers...will be highly appreciated.

BK

Former Member
0 Kudos

Has any body ever used Application Client project.. If so, please guide in this one point..

ekaterinamitova
Advisor
Advisor
0 Kudos

Hi Bala,

I am the information developer responsible for the Application Client documentation. I am glad that I can receive feedback about this documentation.

Which version of the AS Java are you using. There are some differences between the versions.

You can check if the name of the deployed application is the same as the name specified in the Ant script. Pay attention on the initial part whether it is sap/com... ot com/sap.

If it still doesn't work, tell me.

Best regards,

Ekaterina

Former Member
0 Kudos

Hello Ekaterina,

Thanks for the details.

I'm using CE 7.1. I have tried to run the same example ( CalculatorService Client & CalculaterEJBService ) as given in the [help document|http://help.sap.com/saphelp_nwce10/helpdata/en/45/80e5e656be0dece10000000a11466f/content.htm]. But I get the same error for both cases.. i.e <vendor-name> == com.sap as well as sap.com. As suggested by Vladimir, I have also checked the namespace in NWA. It shows vendor-name as sap.com.

Please find below the ant script that has been used in the project. It is exactly same as the one in the help document except for one point. Instead of JC$, I have changed it to J$ as ${engine.install.dir}/$/ in the server has a folder called J02 and NOT JC02.

<?xml version="1.0" encoding="UTF-8"?>
<project name="AppclientRunner" default="execute" basedir=".">
	<property name="engine.install.dir" value="D:/usr/sap" />
	<property name="SID" value="CE2" />
	<property name="JC_NUMBER" value="02" />
	<property name="USERNAME" value="Administrator" />
	<property name="PASSWORD" value="********" />
	<property name="JNDI_FACTORY"
		value="com.sap.engine.services.jndi.InitialContextFactoryImpl" />
	<property name="PROVIDER_URL" value="192.168.*.**:5${JC_NUMBER}04" />
	<property name="EAR_PROJECT_NAME"
		value="sap.com/CalculatorServiceEAR" />

	<path id="appclient.class.path">
		<pathelement path="${java.class.path}/" />
		<pathelement
			path="${engine.install.dir}/${SID}/J${JC_NUMBER}/
              j2ee/j2eeclient/sap.com~tc~exception~impl.jar" />
		<pathelement
			path="${engine.install.dir}/${SID}/J${JC_NUMBER}/
              j2ee/j2eeclient/sap.com~tc~logging~java~impl.jar" />
		<pathelement
			path="${engine.install.dir}/${SID}/J${JC_NUMBER}/
              j2ee/j2eeclient/sap.com~tc~je~clientlib~impl.jar" />
		<pathelement
			path="${engine.install.dir}/${SID}/J${JC_NUMBER}/
              j2ee/cluster/bin/ext/ejb_api/ejb-3_0-api.jar" />
		<pathelement location="CalculatorServiceClient.jar" />
		<pathelement
			location="../CalculatorServiceEJB/CalculatorServiceEJB.jar" />
	</path>

	<target name="execute">
		<java
			classname="com.sap.engine.services.appclient.client.Launcher"
			fork="yes">
			<classpath refid="appclient.class.path" />
			<arg value="-U${USERNAME}" />
			<arg value="-P${PASSWORD}" />
			<arg value="-F${JNDI_FACTORY}" />
			<arg value="-H${PROVIDER_URL}" />
			<arg value="-name" />
			<arg value="${EAR_PROJECT_NAME}" />
		</java>
	</target>
</project>

The help document also says

<vendor-name> by default is sap.com.

Kindly suggest a suitable option to make the application client project up and running.

Many Thanks.

Best regards,

Bala

ekaterinamitova
Advisor
Advisor
0 Kudos

Hi Bala,

My colleagues and I are working on this issue. Can you provide more information about the error?

Best regards,

Ekaterina

Former Member
0 Kudos

Hello Ekaterina,

Thanks for the follow up.

As mentioned earlier, I have followed all the steps given in the [help document|http://help.sap.com/saphelp_nwce10/helpdata/en/45/80e5e656be0dece10000000a11466f/content.htm].

I have used the same ANT script as given [here|http://help.sap.com/saphelp_nwce10/helpdata/en/45/804e0d77fe1956e10000000a11466f/content.htm]. I have set suitable values for each properties in the script

and when I execute the script from NWDS with Run as --> Ant Build option( with default target "execute" ), I get the error,

execute:
     [java] java.lang.NoClassDefFoundError: com/sap/engine/services/appclient/client/Launcher
     [java] Exception in thread "main" 
     [java] Java Result: 1
BUILD SUCCESSFUL
Total time: 1 second

Then I tried adding the four libraries ( specified in the ANT script ) to the class path of the Run Configuration.

Then ANT build threw up the following message.

execute:
     [java] Exception in thread "main" com.sap.engine.services.appclient.client.
AppClientException:Could not get runtime model for application with name: 
sap.com/CalculatorServiceEAR
     [java] 	at com.sap.engine.services.appclient.client.Launcher.main(Launcher.java:152)
     [java] Java Result: 1
BUILD SUCCESSFUL
Total time: 2 seconds

For your reference, I have shared the three projects that I'm using: [Client|http://www.4shared.com/file/87112416/ecfca978/CalcServiceClient.html], [EAR|http://www.4shared.com/file/87112617/987f4d80/CalcServiceEAR.html], [EJB|http://www.4shared.com/file/87112706/f7a12660/CalcServiceEJB.html].

Kindly let me know what I'm missing.

Best regards,

Bala

Former Member
0 Kudos

Hi Bala,

I downloaded the three projects that you are using and I saw that CalculatorServiceEAR.ear does not contain CalculatorServiceClient.jar.

Also the appclient_starter.xml that you are using has newer version, so you could use the following Link: [tutorial|http://help.sap.com/saphelp_nwce711/helpdata/en/45/804e0d77fe1956e10000000a11466f/frameset.htm], which contains the newer version of appclient_starter.xml.

As the implementation of the tutorial does not take much time, I think you could start the tutorial from the begining.

Thank you for your feedback about engine.install.dir parameter I think you are right, it should point to the server installation directory.

Regards,

Ivaylo

Former Member
0 Kudos

Hello Ivaylo,

I downloaded the three projects that you are using and I saw that CalculatorServiceEAR.ear 
does not contain CalculatorServiceClient.jar.

Perfect point that I failed to notice... Thanks Ivaylo for that. I just added the module under the

deployment descriptor of the EAR project and it works like a charm..

However, I think there is a bug in the NWDS. It should have ideally added this jar as I used

the option "Add project to EAR" while creating the application client project..but it didn't..

Another point is that I have added the jars to the classpath manually as the script is not able to pick it up

from the engine.install.dir path..

Thanks again...

Best regards,

Bala

Answers (0)