cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy EAR using Ant

Former Member
0 Kudos

Hi

I've found some useful documentation on deploying EAR files to SAP using the sapdeploy Ant task, and would like to start using it. Unfortunately the docs don't specify where the Ant task can be located, and what its dependencies are.

Please could someone help point me in the right direction with this?

Here's a link to the docs I'm referring to.

http://help.sap.com/saphelp_nwce711/helpdata/EN/3c/52413e7bcd561ee10000000a114084/frameset.htm

Thanks

Stuart

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I managed to find the Ant task jar, and related dependencies.

However, when I try execute the sapimportear task, it fails with a NoClassDefFoundError. I've copied all required jars (as documented on SAP Help) and have searched everywhere for the missing class - but I can't find it.

Please could someone help with this. And could someone from SAP please update the documentation, if required.

[http://help.sap.com/saphelp_nwce711/helpdata/EN/46/150746f21914dce10000000a155369/content.htm]

This is the output:

-



C:\SAP Deployment>c:\apache-ant-1.7.1\bin\ant -f build.xml createsda
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: build.xml

createsda:
[sapimportear] root dir C:\SAP Deployment\archives

BUILD FAILED
java.lang.NoClassDefFoundError: com/sap/engine/deployment/PropertiesHolder
        at com.sap.engine.services.dc.ant.convert.SAPImportEAR.execute(SAPImportEAR.java:26)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.ClassNotFoundException: com.sap.engine.deployment.PropertiesHolder
        at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)
        at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        ... 18 more

Total time: 0 seconds

Thanks

Edited by: Stuart Gunter on Jun 1, 2009 11:06 AM

Former Member
0 Kudos

Sorry, that last post looks horrid, but none of the formatting options in the SAP forum post editor are working.

Former Member
0 Kudos

Hi Stuart, sorry for warming up this old thread,

but I'm facing the same issues here. Could you post a list of the dependencies

that are needed to execute the ant task? Unfortunately, the SAP docs were

not updated...

TIA,

Jens

Former Member
0 Kudos

Hi Jens

Have you tried copying the other jar files from the deployment\lib folder? That might help. The com.sap.engine.deployment.PropertiesHolder class is in the sap.comtcjedeployment14impl.jar file, but I'm not sure if that has further dependencies that are required.

I usually just run the Ant tasks from the deployment folder, just to be sure they work ok. In the deployment\scripts folder, there is an example_build.xml that shows a whole bunch of references to other jar files that should be in the classpath. The only other suggestion I would make is for you to try copying all of those files to the location where you're running from (or simply reference them if you're on the same server).

Hope that helps.

Stuart

Former Member
0 Kudos

Hi Jens (again)

Just in case you're still battling with this, I've just written a blog post about how to use the SAP Ant task for deployment. There's a sample build.xml that you can download and work with, which makes it so much easier!

If you have any suggestions for improvement, they would be most welcome.

http://www.g3it.com/technical/java/sap-deployment-with-ant/