javax.persistence.Persistence classNotFoundError

2016-04-29 Thread Ananth Gundabattula
Hello All,

I am getting the following exception when I launch my Apex app.

I tried including javaee-api- version 7.0 as well to get around this error
but does not seem to take effect.

Any ideas why javax.persistence.Persistence is not getting loaded by the
APex engine classloader ?

An error occurred trying to launch the application. Server message:
> java.lang.NoClassDefFoundError: javax/persistence/Persistence at
> org.apache.bval.jsr303.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:34)
> at
> org.apache.bval.jsr303.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:60)
> at
> org.apache.bval.jsr303.resolver.CachingTraversableResolver.isReachable(CachingTraversableResolver.java:82)
> at
> org.apache.bval.jsr303.ConstraintValidation.isReachable(ConstraintValidation.java:241)
> at
> org.apache.bval.jsr303.ConstraintValidation.validate(ConstraintValidation.java:166)
> at
> org.apache.bval.jsr303.ConstraintValidation.validate(ConstraintValidation.java:141)
> at
> org.apache.bval.util.ValidationHelper.validateProperty(ValidationHelper.java:233)
> at
> org.apache.bval.util.ValidationHelper.validateBean(ValidationHelper.java:216)
> at
> org.apache.bval.jsr303.ClassValidator.validateBeanNet(ClassValidator.java:393)
> at org.apache.bval.jsr303.ClassValidator.validate(ClassValidator.java:149)
> at
> com.datatorrent.stram.plan.logical.LogicalPlan.validate(LogicalPlan.java:1672)
> at com.datatorrent.stram.StramClient.(StramClient.java:161) at
> com.datatorrent.stram.client.StramAppLauncher.launchApp(StramAppLauncher.java:509)
> at com.datatorrent.stram.cli.DTCli$LaunchCommand.execute(DTCli.java:2050)
> at com.datatorrent.stram.cli.DTCli.launchAppPackage(DTCli.java:3456) at
> com.datatorrent.stram.cli.DTCli.access$7100(DTCli.java:106) at
> com.datatorrent.stram.cli.DTCli$LaunchCommand.execute(DTCli.java:1895) at
> com.datatorrent.stram.cli.DTCli$3.run(DTCli.java:1449) Fatal error
> encountered


Regards,
Ananth


Re: Best practises to specify the Application

2016-04-29 Thread Ananth Gundabattula
Just wanted to update you all that upgrading the JDK on Apex server did the
trick.

Thanks a lot for your time David/Shubham/Sandeep/Ram.

On Sat, Apr 30, 2016 at 6:51 AM, Ananth Gundabattula <
agundabatt...@gmail.com> wrote:

>
> I guess the issue is related to the fact that the runtime jdk which Apex
> server engine is running on a lower version than that of the compiled app
> and not the archetype issue at all. I did attempt with the archetype as
> well but came up with the same effect.  The app is compiled using 1.8
> source + target but the Apex server is running on a machine with jdk 1.7
> installed. That was the root cause. By the way, the original pom project
> artifact had the exact project structure as that was generated by the
> archetype. I shall make sure I use the archetype from hence on. The pom
> attached also explictly defines the jdk versions for both source and
> target.
>
> The web UI while installing the apa package failed with a Fatal error and
> on refreshing showed the entry for the apa package but did not show any
> applications inside it. I guess we have a bug in the UI wherein an improper
> installation of an app results in an entry being shown in the UI. I believe
> it should not show the app entry at all if the installation fails.
>
> Regards,
> Ananth
>
> On Sat, Apr 30, 2016 at 3:54 AM, David Yan  wrote:
>
>> Hi Ananth,
>>
>> Please always use the archetype to generate your project.
>> In the archetype, among many other things, it also enforces that the
>> target java class files to be compatible with JDK 1.7.
>> And it seems that your project is missing that as well and that's why you
>> see the UnsupportedClassVersionError  error.
>>
>> David
>>
>> On Fri, Apr 29, 2016 at 1:20 AM, Ananth Gundabattula <
>> agundabatt...@gmail.com> wrote:
>>
>>> I had a look at the dtgateway.log and observed the following stacktrace
>>> : I guess the root cause might be Apex running on a lower version of java
>>> and the application code compiled with a higher version. I shall update
>>> everyone after the upgrade to see if it fixes the issue.
>>>
>>>
>>> Fatal error encountered

 2016-04-29 08:04:45,181 ERROR
 com.datatorrent.gateway.resources.ws.v2.WSResource: Caught exception
 com.datatorrent.gateway.y: java.lang.UnsupportedClassVersionError:
 com/tx/y/z/Operator : Unsupported major.minor version 52.0
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
 at
 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
 at
 com.datatorrent.stram.webapp.OperatorDiscoverer.addDefaultValue(OperatorDiscoverer.java:297)
 at
 com.datatorrent.stram.cli.DTCli$GetJarOperatorClassesCommand.execute(DTCli.java:3010)
 at
 com.datatorrent.stram.cli.DTCli$GetAppPackageOperatorsCommand.execute(DTCli.java:3755)
 at com.datatorrent.stram.cli.DTCli$3.run(DTCli.java:1449)

>>>
>>>
>>> On Fri, Apr 29, 2016 at 5:49 PM, Ananth Gundabattula <
>>> agundabatt...@gmail.com> wrote:
>>>
 Thanks Shubham.

 Those properties were being set by the parent pom which are inherited
 by the current pom.xml ( Kind of wanted all apex apps to have same version
 structure etc) and hence added that property as part of parent pom.

 I am still stumped as to what is causing this.

 Regards,
 Ananth



 On Fri, Apr 29, 2016 at 4:23 PM, Shubham Pathak <
 shub...@datatorrent.com> wrote:

> Hi Ananth,
>
> I tried $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>  -DarchetypeArtifactId=apex-app-archetype 
> -DarchetypeVersion=3.3.0-incubating
>  -DgroupId=com.example -Dpackage=com.example.mydtapp -DartifactId=mydtapp
>  -Dversion=1.0-SNAPSHOT
> and it works for me as well.
>
> I compared the pom.xml file and noticed values for following
> properties were missing.
>  
>
>
> ${apache.apex.apppackage.classpath}
>
> ${apache.apex.engine.version}
>
>  
>
> Could you add the following to pom.xml and try again.
>
>  
> 
> 
> 3.3.0-incubating
> 
> lib/*.jar
>   
>
>
> Thanks,
> Shubham
>

Re: Best practises to specify the Application

2016-04-29 Thread Ananth Gundabattula
I guess the issue is related to the fact that the runtime jdk which Apex
server engine is running on a lower version than that of the compiled app
and not the archetype issue at all. I did attempt with the archetype as
well but came up with the same effect.  The app is compiled using 1.8
source + target but the Apex server is running on a machine with jdk 1.7
installed. That was the root cause. By the way, the original pom project
artifact had the exact project structure as that was generated by the
archetype. I shall make sure I use the archetype from hence on. The pom
attached also explictly defines the jdk versions for both source and
target.

The web UI while installing the apa package failed with a Fatal error and
on refreshing showed the entry for the apa package but did not show any
applications inside it. I guess we have a bug in the UI wherein an improper
installation of an app results in an entry being shown in the UI. I believe
it should not show the app entry at all if the installation fails.

Regards,
Ananth

On Sat, Apr 30, 2016 at 3:54 AM, David Yan  wrote:

> Hi Ananth,
>
> Please always use the archetype to generate your project.
> In the archetype, among many other things, it also enforces that the
> target java class files to be compatible with JDK 1.7.
> And it seems that your project is missing that as well and that's why you
> see the UnsupportedClassVersionError  error.
>
> David
>
> On Fri, Apr 29, 2016 at 1:20 AM, Ananth Gundabattula <
> agundabatt...@gmail.com> wrote:
>
>> I had a look at the dtgateway.log and observed the following stacktrace :
>> I guess the root cause might be Apex running on a lower version of java and
>> the application code compiled with a higher version. I shall update
>> everyone after the upgrade to see if it fixes the issue.
>>
>>
>> Fatal error encountered
>>>
>>> 2016-04-29 08:04:45,181 ERROR
>>> com.datatorrent.gateway.resources.ws.v2.WSResource: Caught exception
>>> com.datatorrent.gateway.y: java.lang.UnsupportedClassVersionError:
>>> com/tx/y/z/Operator : Unsupported major.minor version 52.0
>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
>>> at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>>> at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>>> at
>>> com.datatorrent.stram.webapp.OperatorDiscoverer.addDefaultValue(OperatorDiscoverer.java:297)
>>> at
>>> com.datatorrent.stram.cli.DTCli$GetJarOperatorClassesCommand.execute(DTCli.java:3010)
>>> at
>>> com.datatorrent.stram.cli.DTCli$GetAppPackageOperatorsCommand.execute(DTCli.java:3755)
>>> at com.datatorrent.stram.cli.DTCli$3.run(DTCli.java:1449)
>>>
>>
>>
>> On Fri, Apr 29, 2016 at 5:49 PM, Ananth Gundabattula <
>> agundabatt...@gmail.com> wrote:
>>
>>> Thanks Shubham.
>>>
>>> Those properties were being set by the parent pom which are inherited by
>>> the current pom.xml ( Kind of wanted all apex apps to have same version
>>> structure etc) and hence added that property as part of parent pom.
>>>
>>> I am still stumped as to what is causing this.
>>>
>>> Regards,
>>> Ananth
>>>
>>>
>>>
>>> On Fri, Apr 29, 2016 at 4:23 PM, Shubham Pathak >> > wrote:
>>>
 Hi Ananth,

 I tried $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
  -DarchetypeArtifactId=apex-app-archetype 
 -DarchetypeVersion=3.3.0-incubating
  -DgroupId=com.example -Dpackage=com.example.mydtapp -DartifactId=mydtapp
  -Dversion=1.0-SNAPSHOT
 and it works for me as well.

 I compared the pom.xml file and noticed values for following properties
 were missing.
  


 ${apache.apex.apppackage.classpath}

 ${apache.apex.engine.version}

  

 Could you add the following to pom.xml and try again.

  
 
 
 3.3.0-incubating
 
 lib/*.jar
   


 Thanks,
 Shubham

 On Fri, Apr 29, 2016 at 11:12 AM, Ananth Gundabattula <
 agundabatt...@gmail.com> wrote:

> Hello David,
>
> I reattempted the packaging with the archetype based approach. I guess
> the 3.3.0 archetype did not exist when I attempted it earlier. Thanks for
> pointing it out.
>
> The default package generated by the archetype 

Re: Best practises to specify the Application

2016-04-29 Thread David Yan
Hi Ananth,

Please always use the archetype to generate your project.
In the archetype, among many other things, it also enforces that the target
java class files to be compatible with JDK 1.7.
And it seems that your project is missing that as well and that's why you
see the UnsupportedClassVersionError  error.

David

On Fri, Apr 29, 2016 at 1:20 AM, Ananth Gundabattula <
agundabatt...@gmail.com> wrote:

> I had a look at the dtgateway.log and observed the following stacktrace :
> I guess the root cause might be Apex running on a lower version of java and
> the application code compiled with a higher version. I shall update
> everyone after the upgrade to see if it fixes the issue.
>
>
> Fatal error encountered
>>
>> 2016-04-29 08:04:45,181 ERROR
>> com.datatorrent.gateway.resources.ws.v2.WSResource: Caught exception
>> com.datatorrent.gateway.y: java.lang.UnsupportedClassVersionError:
>> com/tx/y/z/Operator : Unsupported major.minor version 52.0
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
>> at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>> at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>> at
>> com.datatorrent.stram.webapp.OperatorDiscoverer.addDefaultValue(OperatorDiscoverer.java:297)
>> at
>> com.datatorrent.stram.cli.DTCli$GetJarOperatorClassesCommand.execute(DTCli.java:3010)
>> at
>> com.datatorrent.stram.cli.DTCli$GetAppPackageOperatorsCommand.execute(DTCli.java:3755)
>> at com.datatorrent.stram.cli.DTCli$3.run(DTCli.java:1449)
>>
>
>
> On Fri, Apr 29, 2016 at 5:49 PM, Ananth Gundabattula <
> agundabatt...@gmail.com> wrote:
>
>> Thanks Shubham.
>>
>> Those properties were being set by the parent pom which are inherited by
>> the current pom.xml ( Kind of wanted all apex apps to have same version
>> structure etc) and hence added that property as part of parent pom.
>>
>> I am still stumped as to what is causing this.
>>
>> Regards,
>> Ananth
>>
>>
>>
>> On Fri, Apr 29, 2016 at 4:23 PM, Shubham Pathak 
>> wrote:
>>
>>> Hi Ananth,
>>>
>>> I tried $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>>>  -DarchetypeArtifactId=apex-app-archetype 
>>> -DarchetypeVersion=3.3.0-incubating
>>>  -DgroupId=com.example -Dpackage=com.example.mydtapp -DartifactId=mydtapp
>>>  -Dversion=1.0-SNAPSHOT
>>> and it works for me as well.
>>>
>>> I compared the pom.xml file and noticed values for following properties
>>> were missing.
>>>  
>>>
>>>
>>> ${apache.apex.apppackage.classpath}
>>>
>>> ${apache.apex.engine.version}
>>>
>>>  
>>>
>>> Could you add the following to pom.xml and try again.
>>>
>>>  
>>> 
>>> 
>>> 3.3.0-incubating
>>> 
>>> lib/*.jar
>>>   
>>>
>>>
>>> Thanks,
>>> Shubham
>>>
>>> On Fri, Apr 29, 2016 at 11:12 AM, Ananth Gundabattula <
>>> agundabatt...@gmail.com> wrote:
>>>
 Hello David,

 I reattempted the packaging with the archetype based approach. I guess
 the 3.3.0 archetype did not exist when I attempted it earlier. Thanks for
 pointing it out.

 The default package generated by the archetype command seems to be
 working fine when uploading it but the moment I add in my code and
 dependencies it goes back the issue I am seeing :


 My app package looks like app.zip  ( I removed all of the
 application.class for brevity sake ) . Please note that I deleted all the
 jars under /lib folder and the contents of the /app folder in the apa
 pacakge.

 I have also attached a copy of my pom.xml file.

 Could you please advise if you something amiss right away in the
 structure below ? It may be noted that I retained the classes of the
 original simple project generated by the archetype and even they stopped
 showing with the launch button the moment I added in all of the application
 dependencies in maven.

 Regards,
 Ananth

 On Fri, Apr 29, 2016 at 12:01 PM, David Yan 
 wrote:

> Hi Ananth,
>
> I just tried with 3.3.0-incubating with the following and it's
> working:
>
> $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>  -DarchetypeArtifactId=apex-app-archetype
> -DarchetypeVersion=3.3.0-incubating  -DgroupId=com.example
> -Dpackage=com.example.mydtapp 

Re: Best practises to specify the Application

2016-04-29 Thread Sandeep Deshmukh
Apex needs Java 1.7 min.
What is the Java version you are using?

Regards,
Sandeep

On Fri, Apr 29, 2016 at 1:50 PM, Ananth Gundabattula <
agundabatt...@gmail.com> wrote:

> I had a look at the dtgateway.log and observed the following stacktrace :
> I guess the root cause might be Apex running on a lower version of java and
> the application code compiled with a higher version. I shall update
> everyone after the upgrade to see if it fixes the issue.
>
>
> Fatal error encountered
>>
>> 2016-04-29 08:04:45,181 ERROR
>> com.datatorrent.gateway.resources.ws.v2.WSResource: Caught exception
>> com.datatorrent.gateway.y: java.lang.UnsupportedClassVersionError:
>> com/tx/y/z/Operator : Unsupported major.minor version 52.0
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
>> at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>> at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>> at
>> com.datatorrent.stram.webapp.OperatorDiscoverer.addDefaultValue(OperatorDiscoverer.java:297)
>> at
>> com.datatorrent.stram.cli.DTCli$GetJarOperatorClassesCommand.execute(DTCli.java:3010)
>> at
>> com.datatorrent.stram.cli.DTCli$GetAppPackageOperatorsCommand.execute(DTCli.java:3755)
>> at com.datatorrent.stram.cli.DTCli$3.run(DTCli.java:1449)
>>
>
>
> On Fri, Apr 29, 2016 at 5:49 PM, Ananth Gundabattula <
> agundabatt...@gmail.com> wrote:
>
>> Thanks Shubham.
>>
>> Those properties were being set by the parent pom which are inherited by
>> the current pom.xml ( Kind of wanted all apex apps to have same version
>> structure etc) and hence added that property as part of parent pom.
>>
>> I am still stumped as to what is causing this.
>>
>> Regards,
>> Ananth
>>
>>
>>
>> On Fri, Apr 29, 2016 at 4:23 PM, Shubham Pathak 
>> wrote:
>>
>>> Hi Ananth,
>>>
>>> I tried $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>>>  -DarchetypeArtifactId=apex-app-archetype 
>>> -DarchetypeVersion=3.3.0-incubating
>>>  -DgroupId=com.example -Dpackage=com.example.mydtapp -DartifactId=mydtapp
>>>  -Dversion=1.0-SNAPSHOT
>>> and it works for me as well.
>>>
>>> I compared the pom.xml file and noticed values for following properties
>>> were missing.
>>>  
>>>
>>>
>>> ${apache.apex.apppackage.classpath}
>>>
>>> ${apache.apex.engine.version}
>>>
>>>  
>>>
>>> Could you add the following to pom.xml and try again.
>>>
>>>  
>>> 
>>> 
>>> 3.3.0-incubating
>>> 
>>> lib/*.jar
>>>   
>>>
>>>
>>> Thanks,
>>> Shubham
>>>
>>> On Fri, Apr 29, 2016 at 11:12 AM, Ananth Gundabattula <
>>> agundabatt...@gmail.com> wrote:
>>>
 Hello David,

 I reattempted the packaging with the archetype based approach. I guess
 the 3.3.0 archetype did not exist when I attempted it earlier. Thanks for
 pointing it out.

 The default package generated by the archetype command seems to be
 working fine when uploading it but the moment I add in my code and
 dependencies it goes back the issue I am seeing :


 My app package looks like app.zip  ( I removed all of the
 application.class for brevity sake ) . Please note that I deleted all the
 jars under /lib folder and the contents of the /app folder in the apa
 pacakge.

 I have also attached a copy of my pom.xml file.

 Could you please advise if you something amiss right away in the
 structure below ? It may be noted that I retained the classes of the
 original simple project generated by the archetype and even they stopped
 showing with the launch button the moment I added in all of the application
 dependencies in maven.

 Regards,
 Ananth

 On Fri, Apr 29, 2016 at 12:01 PM, David Yan 
 wrote:

> Hi Ananth,
>
> I just tried with 3.3.0-incubating with the following and it's
> working:
>
> $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>  -DarchetypeArtifactId=apex-app-archetype
> -DarchetypeVersion=3.3.0-incubating  -DgroupId=com.example
> -Dpackage=com.example.mydtapp -DartifactId=mydtapp  -Dversion=1.0-SNAPSHOT
>
> Let me know whether this works for you or not.
>
> The system uses the MANIFEST.MF file to get the basic meta information
> on the app package and it looks at all the 

Re: Best practises to specify the Application

2016-04-29 Thread Ananth Gundabattula
I had a look at the dtgateway.log and observed the following stacktrace : I
guess the root cause might be Apex running on a lower version of java and
the application code compiled with a higher version. I shall update
everyone after the upgrade to see if it fixes the issue.


Fatal error encountered
>
> 2016-04-29 08:04:45,181 ERROR
> com.datatorrent.gateway.resources.ws.v2.WSResource: Caught exception
> com.datatorrent.gateway.y: java.lang.UnsupportedClassVersionError:
> com/tx/y/z/Operator : Unsupported major.minor version 52.0
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> at
> com.datatorrent.stram.webapp.OperatorDiscoverer.addDefaultValue(OperatorDiscoverer.java:297)
> at
> com.datatorrent.stram.cli.DTCli$GetJarOperatorClassesCommand.execute(DTCli.java:3010)
> at
> com.datatorrent.stram.cli.DTCli$GetAppPackageOperatorsCommand.execute(DTCli.java:3755)
> at com.datatorrent.stram.cli.DTCli$3.run(DTCli.java:1449)
>


On Fri, Apr 29, 2016 at 5:49 PM, Ananth Gundabattula <
agundabatt...@gmail.com> wrote:

> Thanks Shubham.
>
> Those properties were being set by the parent pom which are inherited by
> the current pom.xml ( Kind of wanted all apex apps to have same version
> structure etc) and hence added that property as part of parent pom.
>
> I am still stumped as to what is causing this.
>
> Regards,
> Ananth
>
>
>
> On Fri, Apr 29, 2016 at 4:23 PM, Shubham Pathak 
> wrote:
>
>> Hi Ananth,
>>
>> I tried $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>>  -DarchetypeArtifactId=apex-app-archetype -DarchetypeVersion=3.3.0-incubating
>>  -DgroupId=com.example -Dpackage=com.example.mydtapp -DartifactId=mydtapp
>>  -Dversion=1.0-SNAPSHOT
>> and it works for me as well.
>>
>> I compared the pom.xml file and noticed values for following properties
>> were missing.
>>  
>>
>>
>> ${apache.apex.apppackage.classpath}
>>
>> ${apache.apex.engine.version}
>>
>>  
>>
>> Could you add the following to pom.xml and try again.
>>
>>  
>> 
>> 3.3.0-incubating
>> 
>> lib/*.jar
>>   
>>
>>
>> Thanks,
>> Shubham
>>
>> On Fri, Apr 29, 2016 at 11:12 AM, Ananth Gundabattula <
>> agundabatt...@gmail.com> wrote:
>>
>>> Hello David,
>>>
>>> I reattempted the packaging with the archetype based approach. I guess
>>> the 3.3.0 archetype did not exist when I attempted it earlier. Thanks for
>>> pointing it out.
>>>
>>> The default package generated by the archetype command seems to be
>>> working fine when uploading it but the moment I add in my code and
>>> dependencies it goes back the issue I am seeing :
>>>
>>>
>>> My app package looks like app.zip  ( I removed all of the
>>> application.class for brevity sake ) . Please note that I deleted all the
>>> jars under /lib folder and the contents of the /app folder in the apa
>>> pacakge.
>>>
>>> I have also attached a copy of my pom.xml file.
>>>
>>> Could you please advise if you something amiss right away in the
>>> structure below ? It may be noted that I retained the classes of the
>>> original simple project generated by the archetype and even they stopped
>>> showing with the launch button the moment I added in all of the application
>>> dependencies in maven.
>>>
>>> Regards,
>>> Ananth
>>>
>>> On Fri, Apr 29, 2016 at 12:01 PM, David Yan 
>>> wrote:
>>>
 Hi Ananth,

 I just tried with 3.3.0-incubating with the following and it's working:

 $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
  -DarchetypeArtifactId=apex-app-archetype
 -DarchetypeVersion=3.3.0-incubating  -DgroupId=com.example
 -Dpackage=com.example.mydtapp -DartifactId=mydtapp  -Dversion=1.0-SNAPSHOT

 Let me know whether this works for you or not.

 The system uses the MANIFEST.MF file to get the basic meta information
 on the app package and it looks at all the jars in the app directory and
 searches for classes that subclass 
 com.datatorrent.api.StreamingApplication.

 David



 On Thu, Apr 28, 2016 at 6:32 PM, Ananth Gundabattula <
 agundabatt...@gmail.com> wrote:

> Hello David,
>
> Regarding as to why I did not use the 

Re: Best practises to specify the Application

2016-04-29 Thread Shubham Pathak
Hi Ananth,

I tried $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
 -DarchetypeArtifactId=apex-app-archetype -DarchetypeVersion=3.3.0-incubating
 -DgroupId=com.example -Dpackage=com.example.mydtapp -DartifactId=mydtapp
 -Dversion=1.0-SNAPSHOT
and it works for me as well.

I compared the pom.xml file and noticed values for following properties
were missing.
 

   ${apache.apex.apppackage.classpath}

${apache.apex.engine.version}

 

Could you add the following to pom.xml and try again.

 

3.3.0-incubating

lib/*.jar
  


Thanks,
Shubham

On Fri, Apr 29, 2016 at 11:12 AM, Ananth Gundabattula <
agundabatt...@gmail.com> wrote:

> Hello David,
>
> I reattempted the packaging with the archetype based approach. I guess the
> 3.3.0 archetype did not exist when I attempted it earlier. Thanks for
> pointing it out.
>
> The default package generated by the archetype command seems to be working
> fine when uploading it but the moment I add in my code and dependencies it
> goes back the issue I am seeing :
>
>
> My app package looks like app.zip  ( I removed all of the
> application.class for brevity sake ) . Please note that I deleted all the
> jars under /lib folder and the contents of the /app folder in the apa
> pacakge.
>
> I have also attached a copy of my pom.xml file.
>
> Could you please advise if you something amiss right away in the structure
> below ? It may be noted that I retained the classes of the  original simple
> project generated by the archetype and even they stopped showing with the
> launch button the moment I added in all of the application dependencies in
> maven.
>
> Regards,
> Ananth
>
> On Fri, Apr 29, 2016 at 12:01 PM, David Yan  wrote:
>
>> Hi Ananth,
>>
>> I just tried with 3.3.0-incubating with the following and it's working:
>>
>> $ mvn archetype:generate  -DarchetypeGroupId=org.apache.apex
>>  -DarchetypeArtifactId=apex-app-archetype
>> -DarchetypeVersion=3.3.0-incubating  -DgroupId=com.example
>> -Dpackage=com.example.mydtapp -DartifactId=mydtapp  -Dversion=1.0-SNAPSHOT
>>
>> Let me know whether this works for you or not.
>>
>> The system uses the MANIFEST.MF file to get the basic meta information on
>> the app package and it looks at all the jars in the app directory and
>> searches for classes that subclass com.datatorrent.api.StreamingApplication.
>>
>> David
>>
>>
>>
>> On Thu, Apr 28, 2016 at 6:32 PM, Ananth Gundabattula <
>> agundabatt...@gmail.com> wrote:
>>
>>> Hello David,
>>>
>>> Regarding as to why I did not use the archetype, I was building the app
>>> for 3.3.0 version and I was not able to specify an archetype with the
>>> version 3.3.0 when I attempted it. Perhaps there is no archetype for
>>> version 3.3.0 ? I was not sure if the archetype version should match the
>>> exact apex engine version . My presumption was archetype does not matter if
>>> the packaging is done right. So i went ahead and created a simple maven
>>> project.
>>>
>>> The maven assembly plugin used the appPackage.xml and the related
>>> constructs to build the exact file layout of the app as mentioned in the
>>> output above.
>>>
>>> I even attempted this time with MANIFEST.MF entry but to no avail.
>>>
>>> This brings me to a question. How does the engine know which is the main
>>> class that is to be used for launching the Streaming App. I do have a class
>>> that extends the StreaminApplication that is annotated with
>>> ApplicationAnnotation but does not seem to be picking up. By this I mean, I
>>> do not see a "launch" icon next to it. All I see is the top level packaged
>>> name in the web console but nothing beneath it for me to trigger a launch.
>>>
>>> Regards,
>>> Ananth
>>>
>>> On Fri, Apr 29, 2016 at 8:27 AM, David Yan 
>>> wrote:
>>>
 Hi Ananth,

 The MANIFEST.MF file is important, and it's generated automatically if
 the archetype is used. For example, the MANFEST.MF file from the Pi demo in
 Malhar has this content:

 Manifest-Version: 1.0
 Archiver-Version: Plexus Archiver
 Built-By: david
 DT-App-Package-Display-Name: Apache Apex Malhar (incubating) Pi Demo
 Class-Path: lib/*.jar
 DT-Engine-Version: 3.4.0-incubating-SNAPSHOT
 Created-By: Apache Maven 3.3.9
 Build-Jdk: 1.8.0_92
 DT-App-Package-Description: Apex demo applications that calculate the
  value of Pi. This is a starting point to understand how Apex works.
 DT-App-Package-Group-Id: org.apache.apex
 DT-App-Package-Name: pi-demo
 DT-App-Package-Version: 3.4.0-incubating-SNAPSHOT

 Is there a reason why the archetype is not used in your project?

 David

 On Thu, Apr 28, 2016 at 3:10 PM, Ananth Gundabattula <
 agundabatt...@gmail.com> wrote:

> Hello David,
>
> Please find the unzip result at the end of this email. The jar is in
> the app directory inside the apa.
> As to why I did not use the archetype,