command line codegen problems

hello,

I try to build using commandline codegen tool. I am using the sample project from eGate Tutorial (Project 1: This Project addresses a very simple business challenge where an input TimeCard File is read and a workfile is output).

I have had experience doing some build using Ant, but apparently it's not as straightforward as I would've expected with this one.

I have updated the "build.properties" file to match the project as specified on the documentation. The build seems to go okay for a while until it spits the following errors (inlogy.log):

2006-08-07 20:19:23,328 ERROR [main] [com.stc.codegen.anttaskImpl.CodeGen] [] java.lang.reflect.InvocationTargetException

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.stc.codegen.anttaskImpl.CodeGen.execute(CodeGen.java:218)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at org.apache.tools.ant.Main.runBuild(Main.java:668)

at org.apache.tools.ant.Main.startAnt(Main.java:187)

at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)

at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Caused by: com.stc.codegen.framework.model.CodeGenException: C:\JavaCAPS51\commandlinecodegen\temp\1154945927859\Project1dpProject1\CMap1_Service1_ejb\Project1\Collaboration_1.java:15:package dtd.s1_input_420537843 does not exist

publicvoid receive( com.stc.connector.appconn.file.FileTextMessage input, com.stc.connector.appconn.file.FileApplication FileClient_1, dtd.s1_input_420537843.Employees s1_input_Employees_1, xsd.s1_output_133304065.Employees s1_output_Employees_1 )

^

C:\JavaCAPS51\commandlinecodegen\temp\1154945927859\Project1dpProject1\CMap1_Service1_ejb\Project1\Collaboration_1.java:15:package xsd.s1_output_133304065 does not exist

publicvoid receive( com.stc.connector.appconn.file.FileTextMessage input, com.stc.connector.appconn.file.FileApplication FileClient_1, dtd.s1_input_420537843.Employees s1_input_Employees_1, xsd.s1_output_133304065.Employees s1_output_Employees_1 )

^

C:\JavaCAPS51\commandlinecodegen\temp\1154945927859\Project1dpProject1\CMap1_Service1_ejb\Project1\CMap1_Service1\Collaboration_1_Runtime_Handler.java:372:package dtd.s1_input_420537843 does not exist

(dtd.s1_input_420537843.Employees) params.get("s1_input_Employees_1")

^

C:\JavaCAPS51\commandlinecodegen\temp\1154945927859\Project1dpProject1\CMap1_Service1_ejb\Project1\CMap1_Service1\Collaboration_1_Runtime_Handler.java:374:package xsd.s1_output_133304065 does not exist

(xsd.s1_output_133304065.Employees) params.get("s1_output_Employees_1")

^

Note: C:\JavaCAPS51\commandlinecodegen\temp\1154945927859\Project1dpProject1\CMap1_Service1_ejb\Project1\CMap1_Service1\Collaboration_1_Runtime_Handler.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:uncheckedfor details.

4 errors

at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.compileCodegen(CodeGenFrameworkImpl.java:802)

at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkAntImpl.doPostProcess(CodeGenFrameworkAntImpl.java:452)

at com.stc.codegen.anttaskImpl.driver.BuildProject.doPostProcess(BuildProject.java:560)

... 25 more

Caused by: Compile failed; see the compiler error outputfor details.

at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)

at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)

at com.stc.codegen.frameworkImpl.model.util.AntTasksWrapperImpl.javac(AntTasksWrapperImpl.java:285)

at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.compileCodegen(CodeGenFrameworkImpl.java:795)

... 27 more

As can be seen, it failed on the receive() method of the Collaboration, cannot find the package dtd.s1_input_420537843.Employees and xsd.s1_output_133304065.Employees.

Also, there were some errors to do with velocity:

2006-08-07 20:18:51,734 ERROR [main] [com.stc.codegen.frameworkImpl.model.util.AntVelocityHelperImpl] [] ResourceManager : unable to find resource'velocity-templates/VM_global_library.vm' in any resource loader.

Within eDesigner, it builds sucessfully indeed. No issues whatsoever.

As, we have many deployment profiles, building it one by one in eDesigner is very tedious. So, I'd like to get the command line build tool to do the job so we can have unattended build process and possibly use the deploycli tool in combination.

Any idea on the errors? Has anyone sucessfully used the command line codegen?

Thanks in advance

Ari

[6461 byte] By [awid2] at [2007-11-26 9:17:34]
# 1

Hello Ari,

I am able to successfully build the project using codegen , command line tool. I tested the same timecard project from the sample projects

It works fine for me.

I think the error you are getting is related to OTDs.

When u created the JCDs did u include all the 3 OTD , file , S1_input_employees , s1_output_employees.

Right click the collab and in properties check if all the three OTDs are listed

Let me know if they are listed and still u r getting the error

CAPSHelp at 2007-7-6 23:45:33 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 2

Please make sure the following before running commandline codegen

1) Check your ANT_HOME .It must be version greater than or equal to 1.6.2

2) Check your JAVA_HOME. It must be 1.4.2 ( Doesn't run with 1.5)

3) Run java -version to confirm

4) Run ant -version to confirm

5) Make sure the project has Deployment profile already created in CAPS.

Commandline codegen doesnt create Deployment profile, instead it uses the

Deployment profile created in CAPS.

sreenigv at 2007-7-6 23:45:33 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 3

Thanks all for the instant reply.

CAPSHelp: I've got all the OTDs listed.

sreenigv: I have gone thru all your checklist and I've done everything right except that I'm using Java 1.5 Thanks for pointing that out. It works now if using 1.4.2

Out of curiousity, why wouldn't it work with 1.5?

cheers

Ari

awid2 at 2007-7-6 23:45:33 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...
# 4
CAPS code is written based on jdk 1.4.2 . It is not compatible with 1.5
sreenigv at 2007-7-6 23:45:33 > top of Java-index,Java Enterprise System,Java Composite Application Platform Suite -- General Discussion...