Re: Gradle and Eclipse

2015-08-14 Thread Dennis Bliefernicht
Oh dear, down the NSBundle rabbit hole ;-)

 On 13 Aug 2015, at 15:41, Yoann Canal yca...@sophiacom.fr wrote:
 
 On 12/08/15 09:12, Dennis Bliefernicht wrote:
 HI,
 
 - download woproject.jar only once instead of once per framework
 - remove reference to nexus.xyrality.net http://nexus.xyrality.net/
 - remove postgres dependencies
 - allow setting webobjectsVersion / wonderVersion before applying the 
 plugin since automatically added frameworks will use the default versions 
 otherwise
 
 Feel absolutely free to submit pull requests, preferable separate ones for 
 this :-) Generally we're not that happy either yet with the default 
 dependency mechanism; while fine for most projects sometimes you want to 
 switch out some dependency which is not that easy to do afterwards in Gradle.
 
 Will do :)
 Our only trouble with dependencies has been with WOUnit that get outdated 
 dependencies so our fork contains
 testCompile(group: 'com.wounit', name: 'wounit', version: '1.2.1') {
 transitive = false
 }
 and we manually add the required dependencies afterward.

If transitive dependencies are the issue, you should always be able to override 
them with newer versions, even if transitive = false has not been specified. 
Another pitfall though with WO/Wonder is the possibility of some libraries 
being completely included into other libraries (e.g. JavaXML contains a copy of 
log4j, XML parsers, commons-logging, ...). This can really trip you up add a 
newer version of the library and get weird MethodNotFoundException because some 
new class mixes up with some old class.

 That's the scenario we tried. We use eclipse 4.5 (I think Antoine tried on 
 4.4), gradle 2.4 and our fork of the gradle-plugin.
 The projects were imported using the import existing project menu, not the 
 gradle import.
 .project file contains org.objectstyle.wolips.incrementalbuilder and 
 org.objectstyle.wolips.incrementalframeworknature :(

Too bad, that would have been an easy one :-) Could you try importing it as 
proper Gradle project using the Eclipse Gradle Plugin? We had success with 
https://marketplace.eclipse.org/content/gradle-ide-pack 
https://marketplace.eclipse.org/content/gradle-ide-pack (only need the IDE 
pack). Then Import - Gradle - Gradle Project - Select root project folder - 
Build Model - Select projects - Import.

 Linking to the JavaWebObjects library instead of the .jar gives another 
 exception but I'm not sure this can help:
 [...]
 [2015-8-13 14:59:24 CEST] main NSBundle is unable to find 
 ExtensionsForResources.plist in the main bundle.  Ignoring optional 
 configuration file.
 [2015-8-13 14:59:24 CEST] main Cannot use rapid turnaround.  Please start 
 Xcode and open the project for this application.
 [2015-8-13 14:59:24 CEST] main WOProjectBundle: Warning - Unable to find 
 project at path /Users/ycanal/ - Ignoring project.
 [2015-8-13 14:59:24 CEST] main java.lang.StringIndexOutOfBoundsException: 
 String index out of range: 18
 at java.lang.String.substring(String.java:1951)
 at 
 com.webobjects._ideservices._WOAntProject.antProjectAtPath(_WOAntProject.java:62)
 at 
 com.webobjects._ideservices._WOProject.ideProjectAtPath(_WOProject.java:106)

Looks like it did not properly recognize the project as Eclipse project, which 
is why it tries to use the Ant loader. Is the project being built properly by 
eclipse in build/YourApp.woa? 

 [2015-8-13 14:59:24 CEST] main A fatal exception occurred: ERXExtensions 
 have not been initialized. Debugging information can be enabled by adding the 
 JVM argument: '-Der.extensions.appserver.projectBundleLoading=DEBUG'. Please 
 report the classpath and the rest of the bundles to the Wonder mailing list: 
 Remaining frameworks: [JavaFoundation, ERModernLook, ERCoreBusinessLogic, 
 ERTaggable, JavaJDBCAdaptor, ERRest, JavaXML, WOLips, ERCoolComponents, 
 ERPrototypes, ExcelGenerator, JavaWOExtensions, JavaDTWGeneration, 
 ERAttachment, JavaEOControl, Ajax, MySQLPlugIn, JavaEOAccess, GoogleChart, 
 JavaDirectToWeb, ERCoreBusinessLogicDTW, ERJavaMail, ERExcelLook, 
 JavaEOProject, JavaMemoryAdaptor, ERModernDefaultSkin, ERDirectToWeb, 
 ERQuartzScheduler, ERExtensions, WOOgnl, ERModernDirectToWeb]
 Classpath: [...]

Actually how does the classpath look like? Especially: is ERExtensions from 
wonder still in front of other WO libraries?

Greetings
Dennis
--





-
Dennis Bliefernicht • Backend Development
T +49 40 357 3001 62
dennis.blieferni...@xyrality.com

XYRALITY GmbH • Friedensallee 290 • 22763 Hamburg
www.xyrality.com http://www.xyrality.com/
Registergericht: Hamburg HRB 115332
Geschäftsführer: Sven Ossenbrüggen
-

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com

Re: Gradle and Eclipse

2015-08-14 Thread Yoann Canal

Hello again,

On 14/08/15 08:20, Dennis Bliefernicht wrote:

Oh dear, down the NSBundle rabbit hole ;-)

On 13 Aug 2015, at 15:41, Yoann Canal yca...@sophiacom.fr 
mailto:yca...@sophiacom.fr wrote:


On 12/08/15 09:12, Dennis Bliefernicht wrote:

HI,


- download woproject.jar only once instead of once per framework
- remove reference tonexus.xyrality.net http://nexus.xyrality.net/
- remove postgres dependencies
- allow setting webobjectsVersion / wonderVersion before applying 
the plugin since automatically added frameworks will use the 
default versions otherwise


Feel absolutely free to submit pull requests, preferable separate 
ones for this :-) Generally we're not that happy either yet with the 
default dependency mechanism; while fine for most projects 
sometimes you want to switch out some dependency which is not that 
easy to do afterwards in Gradle.



Will do :)
Our only trouble with dependencies has been with WOUnit that get 
outdated dependencies so our fork contains

testCompile(group: 'com.wounit', name: 'wounit', version: '1.2.1') {
transitive = false
}
and we manually add the required dependencies afterward.


If transitive dependencies are the issue, you should always be able to 
override them with newer versions, even if transitive = false has not 
been specified. Another pitfall though with WO/Wonder is the 
possibility of some libraries being completely included into other 
libraries (e.g. JavaXML contains a copy of log4j, XML parsers, 
commons-logging, ...). This can really trip you up add a newer version 
of the library and get weird MethodNotFoundException because some new 
class mixes up with some old class.


Then I suspect our problem was a bit more than transitive dependencies, 
maybe classpath ordering ? :/
That's the scenario we tried. We use eclipse 4.5 (I think Antoine 
tried on 4.4), gradle 2.4 and our fork of the gradle-plugin.
The projects were imported using the import existing project menu, 
not the gradle import.
.project file contains org.objectstyle.wolips.incrementalbuilder and 
org.objectstyle.wolips.incrementalframeworknature :(


Too bad, that would have been an easy one :-) Could you try importing 
it as proper Gradle project using the Eclipse Gradle Plugin? We had 
success with 
https://marketplace.eclipse.org/content/gradle-ide-pack (only need the 
IDE pack). Then Import - Gradle - Gradle Project - Select root 
project folder - Build Model - Select projects - Import.

Using this import it works for both of my colleagues but not for me :'(

Linking to the JavaWebObjects library instead of the .jar gives 
another exception but I'm not sure this can help:

[...]
[2015-8-13 14:59:24 CEST] main NSBundle is unable to find 
ExtensionsForResources.plist in the main bundle. Ignoring optional 
configuration file.
[2015-8-13 14:59:24 CEST] main Cannot use rapid turnaround.  Please 
start Xcode and open the project for this application.
[2015-8-13 14:59:24 CEST] main WOProjectBundle: Warning - Unable 
to find project at path /Users/ycanal/ - Ignoring project.
[2015-8-13 14:59:24 CEST] main 
java.lang.StringIndexOutOfBoundsException: String index out of range: 18

at java.lang.String.substring(String.java:1951)
at 
com.webobjects._ideservices._WOAntProject.antProjectAtPath(_WOAntProject.java:62)
at 
com.webobjects._ideservices._WOProject.ideProjectAtPath(_WOProject.java:106)


Looks like it did not properly recognize the project as Eclipse 
project, which is why it tries to use the Ant loader. Is the project 
being built properly by eclipse in build/YourApp.woa?


I'm not sure what to expect in build/YourApp.woa. After an eclipse build 
it only contains Content, not the run script or WOBootstrap.jar but it 
still works for my colleagues.
[2015-8-13 14:59:24 CEST] main A fatal exception occurred: 
ERXExtensions have not been initialized. Debugging information can be 
enabled by adding the JVM argument: 
'-Der.extensions.appserver.projectBundleLoading=DEBUG'. Please report 
the classpath and the rest of the bundles to the Wonder mailing list:
Remaining frameworks: [JavaFoundation, ERModernLook, 
ERCoreBusinessLogic, ERTaggable, JavaJDBCAdaptor, ERRest, JavaXML, 
WOLips, ERCoolComponents, ERPrototypes, ExcelGenerator, 
JavaWOExtensions, JavaDTWGeneration, ERAttachment, JavaEOControl, 
Ajax, MySQLPlugIn, JavaEOAccess, GoogleChart, JavaDirectToWeb, 
ERCoreBusinessLogicDTW, ERJavaMail, ERExcelLook, JavaEOProject, 
JavaMemoryAdaptor, ERModernDefaultSkin, ERDirectToWeb, 
ERQuartzScheduler, ERExtensions, WOOgnl, ERModernDirectToWeb]

Classpath: [...]


Actually how does the classpath look like? Especially: is ERExtensions 
from wonder still in front of other WO libraries?
The .classpath looks correct after a 'gradle eclipse' but after an 
import in eclipse it's empty:

?xml version=1.0 encoding=UTF-8?
classpath
classpathentry kind=src path=Resources/
classpathentry kind=src path=Sources/
classpathentry kind=src path=Components/
classpathentry kind

Re: Gradle and Eclipse

2015-08-14 Thread Yoann Canal

Hello,

I made it work by re-installing WebObjects and eclipse, deleting all 
remaining configuration ...

Thanks for your help even if we still don't know what the trouble was :/
Happy to see our small contributions merged by the way :)

Yoann

On 14/08/15 16:29, Yoann Canal wrote:

Hello again,

On 14/08/15 08:20, Dennis Bliefernicht wrote:

Oh dear, down the NSBundle rabbit hole ;-)


On 13 Aug 2015, at 15:41, Yoann Canal yca...@sophiacom.fr wrote:

On 12/08/15 09:12, Dennis Bliefernicht wrote:

HI,


- download woproject.jar only once instead of once per framework
- remove reference tonexus.xyrality.net http://nexus.xyrality.net/
- remove postgres dependencies
- allow setting webobjectsVersion / wonderVersion before applying 
the plugin since automatically added frameworks will use the 
default versions otherwise


Feel absolutely free to submit pull requests, preferable separate 
ones for this :-) Generally we're not that happy either yet with 
the default dependency mechanism; while fine for most projects 
sometimes you want to switch out some dependency which is not that 
easy to do afterwards in Gradle.



Will do :)
Our only trouble with dependencies has been with WOUnit that get 
outdated dependencies so our fork contains

testCompile(group: 'com.wounit', name: 'wounit', version: '1.2.1') {
transitive = false
}
and we manually add the required dependencies afterward.


If transitive dependencies are the issue, you should always be able 
to override them with newer versions, even if transitive = false has 
not been specified. Another pitfall though with WO/Wonder is the 
possibility of some libraries being completely included into other 
libraries (e.g. JavaXML contains a copy of log4j, XML parsers, 
commons-logging, ...). This can really trip you up add a newer 
version of the library and get weird MethodNotFoundException because 
some new class mixes up with some old class.


Then I suspect our problem was a bit more than transitive 
dependencies, maybe classpath ordering ? :/
That's the scenario we tried. We use eclipse 4.5 (I think Antoine 
tried on 4.4), gradle 2.4 and our fork of the gradle-plugin.
The projects were imported using the import existing project menu, 
not the gradle import.
.project file contains org.objectstyle.wolips.incrementalbuilder and 
org.objectstyle.wolips.incrementalframeworknature :(


Too bad, that would have been an easy one :-) Could you try importing 
it as proper Gradle project using the Eclipse Gradle Plugin? We had 
success with 
https://marketplace.eclipse.org/content/gradle-ide-pack (only need 
the IDE pack). Then Import - Gradle - Gradle Project - Select root 
project folder - Build Model - Select projects - Import.

Using this import it works for both of my colleagues but not for me :'(

Linking to the JavaWebObjects library instead of the .jar gives 
another exception but I'm not sure this can help:

[...]
[2015-8-13 14:59:24 CEST] main NSBundle is unable to find 
ExtensionsForResources.plist in the main bundle. Ignoring optional 
configuration file.
[2015-8-13 14:59:24 CEST] main Cannot use rapid turnaround.  
Please start Xcode and open the project for this application.
[2015-8-13 14:59:24 CEST] main WOProjectBundle: Warning - Unable 
to find project at path /Users/ycanal/ - Ignoring project.
[2015-8-13 14:59:24 CEST] main 
java.lang.StringIndexOutOfBoundsException: String index out of range: 18

at java.lang.String.substring(String.java:1951)
at 
com.webobjects._ideservices._WOAntProject.antProjectAtPath(_WOAntProject.java:62)
at 
com.webobjects._ideservices._WOProject.ideProjectAtPath(_WOProject.java:106)


Looks like it did not properly recognize the project as Eclipse 
project, which is why it tries to use the Ant loader. Is the project 
being built properly by eclipse in build/YourApp.woa?


I'm not sure what to expect in build/YourApp.woa. After an eclipse 
build it only contains Content, not the run script or WOBootstrap.jar 
but it still works for my colleagues.
[2015-8-13 14:59:24 CEST] main A fatal exception occurred: 
ERXExtensions have not been initialized. Debugging information can 
be enabled by adding the JVM argument: 
'-Der.extensions.appserver.projectBundleLoading=DEBUG'. Please 
report the classpath and the rest of the bundles to the Wonder 
mailing list:
Remaining frameworks: [JavaFoundation, ERModernLook, 
ERCoreBusinessLogic, ERTaggable, JavaJDBCAdaptor, ERRest, JavaXML, 
WOLips, ERCoolComponents, ERPrototypes, ExcelGenerator, 
JavaWOExtensions, JavaDTWGeneration, ERAttachment, JavaEOControl, 
Ajax, MySQLPlugIn, JavaEOAccess, GoogleChart, JavaDirectToWeb, 
ERCoreBusinessLogicDTW, ERJavaMail, ERExcelLook, JavaEOProject, 
JavaMemoryAdaptor, ERModernDefaultSkin, ERDirectToWeb, 
ERQuartzScheduler, ERExtensions, WOOgnl, ERModernDirectToWeb]

Classpath: [...]


Actually how does the classpath look like? Especially: is 
ERExtensions from wonder still in front of other WO libraries?
The .classpath looks correct after

Re: Gradle and Eclipse

2015-08-13 Thread Yoann Canal

On 12/08/15 09:12, Dennis Bliefernicht wrote:

HI,


- download woproject.jar only once instead of once per framework
- remove reference tonexus.xyrality.net http://nexus.xyrality.net/
- remove postgres dependencies
- allow setting webobjectsVersion / wonderVersion before applying the 
plugin since automatically added frameworks will use the default 
versions otherwise


Feel absolutely free to submit pull requests, preferable separate ones 
for this :-) Generally we're not that happy either yet with the 
default dependency mechanism; while fine for most projects sometimes 
you want to switch out some dependency which is not that easy to do 
afterwards in Gradle.



Will do :)
Our only trouble with dependencies has been with WOUnit that get 
outdated dependencies so our fork contains

testCompile(group: 'com.wounit', name: 'wounit', version: '1.2.1') {
transitive = false
}
and we manually add the required dependencies afterward.
[2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
/Users/ycanal/WebObjects.properties at path: /Users/ycanal
[2015-8-10 16:14:34 CEST] main Unable to initialize WOProperties 
for reason: Cannot find JavaWebObjects framework ! 
java.lang.IllegalStateException: Unable to locate the 
JavaWebObjects bundle
[2015-8-10 16:14:34 CEST] main A fatal exception occurred: 
WOApplication: Cannot be initialized.
[2015-8-10 16:14:34 CEST] main 
com.webobjects.foundation.NSForwardException 
[java.lang.IllegalStateException] Unable to locate the 
JavaWebObjects bundle:WOApplication: Cannot be initialized.
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
   at 
er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
   at 
er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
   at 
fr.sophiacom.corason.foundation.appserver.COCoreApplication.init(COCoreApplication.java:22)

   at fr.sophiacom.app.NRApplication.init(NRApplication.java:19)
   at fr.sophiacom.app.Application.init(Application.java:30)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
   at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

   at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
   at java.lang.Class.newInstance(Class.java:442)
   at 
com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
   at 
er.extensions.appserver.ERXApplication.main(ERXApplication.java:866)

   at fr.sophiacom.app.Application.main(Application.java:25)
Caused by: java.lang.IllegalStateException: Unable to locate the 
JavaWebObjects bundle
   at 
com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:131)
   at 
com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
   at 
com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:779)

   ... 13 more

Do you have any idea how to fix that ?
Right now we are still keeping our old .project / build.xml 
/.classpath but we would like to avoid maintaining 2 configurations.


How did you import the project exactly? Did you keep the old 
.project and .classpath around for that or did you do a fresh import 
using the gradle plugin? There could be some issue with the 
classpath, if the old files are around, best would be to have gradle 
generate new ones. Have a look at the project properties - Build 
path, there should be no more references to WO libraries but only to 
JARs in yourhomefolder/.gradle/ (see attachment), even for all the 
frameworks.
We tried to use gradle + eclipse in a new workspace after a gradle 
cleanEclipse eclipse so the generated .classpath only reference .jar 
as in your screenshot.
It may be a missing (runtime)dependency but the exception is not 
really helpful :(


Does that scenario give you the exact same stack trace? Which Eclipse 
version and Gradle plugin did you use? I investigated the new 
Buildship plugin but that one still has some issues that prevent this 
in a WO context, mainly it doesn't allow the gradle.build to add 
custom project natures. As the WOLips plugin for now is unaware of 
Buildship, the WO build nature never gets added to the project and 
thus some specific WO builders do not run at all. Check your generated 
.project if it includes the build command 
for org.objectstyle.wolips.incrementalbuilder and a project nature 
of org.objectstyle.wolips.incrementalapplicationnature 
or org.objectstyle.wolips.incrementalframeworknature. If this is 
missing, this can also result in some WOLips exceptions, if you try to 
access the WOLips part of the project properties.


That's the scenario we tried. We use eclipse 4.5 (I think Antoine tried 
on 4.4), gradle 2.4 and our fork of the gradle-plugin.
The projects were

Re: Gradle and Eclipse

2015-08-13 Thread Yoann Canal

Hi Daniel,

Dennis wrote a gradle plugin that does most of the heavy lifting. You 
can find it there: https://github.com/Xyrality/gradle-wonder-plugin .


Building a simple single framework or app should be straightforward:
drop a build.gradle file at the root of your framework and follow Dennis 
example.
You will probably need to add a dependency block as described here: 
https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html 
.


Building a multi-framework requires a bit more work: you will need a 
build.gradle file per sub-project and a settings.gradle in the 
meta-project.

This settings.gradle file is used to import all the subprojects.
If your repository is organized like this:
/MyProject/settings.gradle
/MyProject/Frameworks/MyFramework1/build.gradle
/MyProject/Frameworks/MyFramework2/build.gradle
/MyProject/Applications/MyApp/build.gradle

settings.gradle should contain:
include :Frameworks:MyFramework1
include :Frameworks:MyFramework2
include :Frameworks:MyApp

and dependencies in /MyProject/Applications/MyApp/build.gradle could 
look like:

dependencies {
compile project(':Frameworks:MyFramework1')
compile project(':Frameworks:MyFramework2')
}

You can also add a /MyProject/build.gradle file and factorize some of 
your stuff (like the buildscript block and the version):

buildscript {
repositories {
mavenLocal()
mavenCentral()
}

dependencies {
classpath 'com.xyrality.gradle:gradle-wonder-plugin:1.0.0'
}
}
subprojects {
version = '0.0.1'
}

Hope it's enough to get you started,
Yoann

On 11/08/15 18:33, Beatty, Daniel D CIV NAVAIR, 474300D wrote:

Hi gang,
For those of us not cool enough to come, do you have a podcast or something to 
enlighten us on Gradle?Also, do you have solutions for the highly security 
conscious, or at least those who have to stay out of trouble and want to be 
cool.

V/R,

Daniel Beatty, Ph.D.,
IEEE Certified Software Development Professional (CSDP)
Computer Scientist
Code 474300D
1 Administration Circle. M/S 1109
China Lake, CA 93555
daniel.bea...@navy.mil
(760)939-7097




-Original Message-
From: webobjects-dev-bounces+daniel.beatty=navy@lists.apple.com 
[mailto:webobjects-dev-bounces+daniel.beatty=navy@lists.apple.com] On 
Behalf Of Yoann Canal
Sent: Tuesday, August 11, 2015 1:52 AM
To: Dennis Bliefernicht; WebObjects Development
Subject: Re: Gradle and Eclipse

Hi Dennis and thanks for your reply.

On 11/08/15 08:49, Dennis Bliefernicht wrote:


Hi,


On 10 Aug 2015, at 16:25, Yoann Canal  
mailto:yca...@sophiacom.fr yca...@sophiacom.fr wrote:

Hi all,

After the WOWODC and Dennis' talk, we started to migrate our 
build system to use gradle.
The build works well on our staging servers. We had to modify 
the gradle-wonder-plugin to fit our needs
and might issue a pull request if someone is interested.



Always welcome :-) Out of curiosity: what kind of changes?


- download woproject.jar only once instead of once per framework
- remove reference to nexus.xyrality.net
- remove postgres dependencies
- allow setting webobjectsVersion / wonderVersion before applying the plugin 
since automatically added frameworks will use the default versions otherwise

Some other stuff that would probably only be of interest to us:
- use a fixed name for the generated tar.gz to have a fixed archive URL in 
Jenkins
- don't resolve wounit dependencies since it gets outdated jars

You can take a look at https://github.com/Sophiacom/gradle-wonder-plugin for 
those changes.


However, we can't run the eclipse projects as generated with 
gradle:
projects are correctly imported and built, tests run fine but 
running the project itself inside eclipse with WOLips results in:

[2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
/Users/ycanal/WebObjects.properties at path: /Users/ycanal
[2015-8-10 16:14:34 CEST] main Unable to initialize WOProperties for 
reason: Cannot find JavaWebObjects framework ! java.lang.IllegalStateException: Unable to 
locate the JavaWebObjects bundle
[2015-8-10 16:14:34 CEST] main A fatal exception occurred: 
WOApplication: Cannot be initialized.
[2015-8-10 16:14:34 CEST] main com.webobjects.foundation.NSForwardException 
[java.lang.IllegalStateException] Unable to locate the JavaWebObjects 
bundle:WOApplication: Cannot be initialized.
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
   at 
er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
   at 
er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
   at 
fr.sophiacom.corason.foundation.appserver.COCoreApplication.init

Re: Gradle and Eclipse

2015-08-12 Thread Dennis Bliefernicht
HI,

 - download woproject.jar only once instead of once per framework
 - remove reference to nexus.xyrality.net http://nexus.xyrality.net/
 - remove postgres dependencies
 - allow setting webobjectsVersion / wonderVersion before applying the plugin 
 since automatically added frameworks will use the default versions otherwise

Feel absolutely free to submit pull requests, preferable separate ones for this 
:-) Generally we're not that happy either yet with the default dependency 
mechanism; while fine for most projects sometimes you want to switch out some 
dependency which is not that easy to do afterwards in Gradle.

 [2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
 /Users/ycanal/WebObjects.properties at path: /Users/ycanal
 [2015-8-10 16:14:34 CEST] main Unable to initialize WOProperties for 
 reason: Cannot find JavaWebObjects framework ! 
 java.lang.IllegalStateException: Unable to locate the JavaWebObjects 
 bundle
 [2015-8-10 16:14:34 CEST] main A fatal exception occurred: 
 WOApplication: Cannot be initialized.
 [2015-8-10 16:14:34 CEST] main 
 com.webobjects.foundation.NSForwardException 
 [java.lang.IllegalStateException] Unable to locate the JavaWebObjects 
 bundle:WOApplication: Cannot be initialized.
at com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
at 
 er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
at 
 er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
at 
 fr.sophiacom.corason.foundation.appserver.COCoreApplication.init(COCoreApplication.java:22)
at fr.sophiacom.app.NRApplication.init(NRApplication.java:19)
at fr.sophiacom.app.Application.init(Application.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:866)
at fr.sophiacom.app.Application.main(Application.java:25)
 Caused by: java.lang.IllegalStateException: Unable to locate the 
 JavaWebObjects bundle
at 
 com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:131)
at 
 com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
at 
 com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
at com.webobjects.appserver.WOApplication.init(WOApplication.java:779)
... 13 more
 
 Do you have any idea how to fix that ?
 Right now we are still keeping our old .project / build.xml /.classpath but 
 we would like to avoid maintaining 2 configurations.
 
 How did you import the project exactly? Did you keep the old .project and 
 .classpath around for that or did you do a fresh import using the gradle 
 plugin? There could be some issue with the classpath, if the old files are 
 around, best would be to have gradle generate new ones. Have a look at the 
 project properties - Build path, there should be no more references to WO 
 libraries but only to JARs in yourhomefolder/.gradle/ (see attachment), even 
 for all the frameworks. 
 We tried to use gradle + eclipse in a new workspace after a gradle 
 cleanEclipse eclipse so the generated .classpath only reference .jar as in 
 your screenshot.
 It may be a missing (runtime)dependency but the exception is not really 
 helpful :(


Does that scenario give you the exact same stack trace? Which Eclipse version 
and Gradle plugin did you use? I investigated the new Buildship plugin but that 
one still has some issues that prevent this in a WO context, mainly it doesn't 
allow the gradle.build to add custom project natures. As the WOLips plugin for 
now is unaware of Buildship, the WO build nature never gets added to the 
project and thus some specific WO builders do not run at all. Check your 
generated .project if it includes the build command for 
org.objectstyle.wolips.incrementalbuilder and a project nature of 
org.objectstyle.wolips.incrementalapplicationnature or 
org.objectstyle.wolips.incrementalframeworknature. If this is missing, this can 
also result in some WOLips exceptions, if you try to access the WOLips part of 
the project properties.

Greetings
Dennis

--





-
Dennis Bliefernicht • Backend Development
T +49 40 357 3001 62
dennis.blieferni...@xyrality.com

XYRALITY GmbH • Friedensallee 290 • 22763 Hamburg
www.xyrality.com http://www.xyrality.com/
Registergericht: Hamburg HRB 115332
Geschäftsführer: Sven Ossenbrüggen

Re: Gradle and Eclipse

2015-08-11 Thread Dennis Bliefernicht
Hi,

 On 10 Aug 2015, at 16:25, Yoann Canal yca...@sophiacom.fr wrote:
 
 Hi all,
 
 After the WOWODC and Dennis' talk, we started to migrate our build system to 
 use gradle.
 The build works well on our staging servers. We had to modify the 
 gradle-wonder-plugin to fit our needs
 and might issue a pull request if someone is interested.

Always welcome :-) Out of curiosity: what kind of changes?

 However, we can't run the eclipse projects as generated with gradle:
 projects are correctly imported and built, tests run fine but running the 
 project itself inside eclipse with WOLips results in:
 
 [2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
 /Users/ycanal/WebObjects.properties at path: /Users/ycanal
 [2015-8-10 16:14:34 CEST] main Unable to initialize WOProperties for 
 reason: Cannot find JavaWebObjects framework ! 
 java.lang.IllegalStateException: Unable to locate the JavaWebObjects bundle
 [2015-8-10 16:14:34 CEST] main A fatal exception occurred: WOApplication: 
 Cannot be initialized.
 [2015-8-10 16:14:34 CEST] main com.webobjects.foundation.NSForwardException 
 [java.lang.IllegalStateException] Unable to locate the JavaWebObjects 
 bundle:WOApplication: Cannot be initialized.
at com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
at 
 er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
at er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
at 
 fr.sophiacom.corason.foundation.appserver.COCoreApplication.init(COCoreApplication.java:22)
at fr.sophiacom.app.NRApplication.init(NRApplication.java:19)
at fr.sophiacom.app.Application.init(Application.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:866)
at fr.sophiacom.app.Application.main(Application.java:25)
 Caused by: java.lang.IllegalStateException: Unable to locate the 
 JavaWebObjects bundle
at 
 com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:131)
at 
 com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
at 
 com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
at com.webobjects.appserver.WOApplication.init(WOApplication.java:779)
... 13 more
 
 Do you have any idea how to fix that ?
 Right now we are still keeping our old .project / build.xml /.classpath but 
 we would like to avoid maintaining 2 configurations.

How did you import the project exactly? Did you keep the old .project and 
.classpath around for that or did you do a fresh import using the gradle 
plugin? There could be some issue with the classpath, if the old files are 
around, best would be to have gradle generate new ones. Have a look at the 
project properties - Build path, there should be no more references to WO 
libraries but only to JARs in yourhomefolder/.gradle/ (see attachment), even 
for all the frameworks. 



Greetings
Dennis

--





-
Dennis Bliefernicht • Backend Development
T +49 40 357 3001 62
dennis.blieferni...@xyrality.com

XYRALITY GmbH • Friedensallee 290 • 22763 Hamburg
www.xyrality.com http://www.xyrality.com/
Registergericht: Hamburg HRB 115332
Geschäftsführer: Sven Ossenbrüggen
-

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Gradle and Eclipse

2015-08-11 Thread Yoann Canal

Hi Dennis and thanks for your reply.

On 11/08/15 08:49, Dennis Bliefernicht wrote:

Hi,

On 10 Aug 2015, at 16:25, Yoann Canal yca...@sophiacom.fr 
mailto:yca...@sophiacom.fr wrote:


Hi all,

After the WOWODC and Dennis' talk, we started to migrate our build 
system to use gradle.
The build works well on our staging servers. We had to modify the 
gradle-wonder-plugin to fit our needs

and might issue a pull request if someone is interested.


Always welcome :-) Out of curiosity: what kind of changes?


- download woproject.jar only once instead of once per framework
- remove reference to nexus.xyrality.net
- remove postgres dependencies
- allow setting webobjectsVersion / wonderVersion before applying the 
plugin since automatically added frameworks will use the default 
versions otherwise


Some other stuff that would probably only be of interest to us:
- use a fixed name for the generated tar.gz to have a fixed archive URL 
in Jenkins

- don't resolve wounit dependencies since it gets outdated jars

You can take a look at https://github.com/Sophiacom/gradle-wonder-plugin 
for those changes.

However, we can't run the eclipse projects as generated with gradle:
projects are correctly imported and built, tests run fine but running 
the project itself inside eclipse with WOLips results in:


[2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
/Users/ycanal/WebObjects.properties at path: /Users/ycanal
[2015-8-10 16:14:34 CEST] main Unable to initialize WOProperties 
for reason: Cannot find JavaWebObjects framework ! 
java.lang.IllegalStateException: Unable to locate the 
JavaWebObjects bundle
[2015-8-10 16:14:34 CEST] main A fatal exception occurred: 
WOApplication: Cannot be initialized.
[2015-8-10 16:14:34 CEST] main 
com.webobjects.foundation.NSForwardException 
[java.lang.IllegalStateException] Unable to locate the 
JavaWebObjects bundle:WOApplication: Cannot be initialized.
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
   at 
er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
   at 
er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
   at 
fr.sophiacom.corason.foundation.appserver.COCoreApplication.init(COCoreApplication.java:22)

   at fr.sophiacom.app.NRApplication.init(NRApplication.java:19)
   at fr.sophiacom.app.Application.init(Application.java:30)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
   at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

   at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
   at java.lang.Class.newInstance(Class.java:442)
   at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
   at 
er.extensions.appserver.ERXApplication.main(ERXApplication.java:866)

   at fr.sophiacom.app.Application.main(Application.java:25)
Caused by: java.lang.IllegalStateException: Unable to locate the 
JavaWebObjects bundle
   at 
com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:131)
   at 
com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
   at 
com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:779)

   ... 13 more

Do you have any idea how to fix that ?
Right now we are still keeping our old .project / build.xml 
/.classpath but we would like to avoid maintaining 2 configurations.


How did you import the project exactly? Did you keep the old .project 
and .classpath around for that or did you do a fresh import using the 
gradle plugin? There could be some issue with the classpath, if the 
old files are around, best would be to have gradle generate new ones. 
Have a look at the project properties - Build path, there should be 
no more references to WO libraries but only to JARs in 
yourhomefolder/.gradle/ (see attachment), even for all the frameworks.
We tried to use gradle + eclipse in a new workspace after a gradle 
cleanEclipse eclipse so the generated .classpath only reference .jar as 
in your screenshot.
It may be a missing (runtime)dependency but the exception is not really 
helpful :(

Greetings
Dennis

Yoann
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Gradle and Eclipse

2015-08-11 Thread Beatty, Daniel D CIV NAVAIR, 474300D
Hi gang,
For those of us not cool enough to come, do you have a podcast or something to 
enlighten us on Gradle?Also, do you have solutions for the highly security 
conscious, or at least those who have to stay out of trouble and want to be 
cool.

V/R,

Daniel Beatty, Ph.D., 
IEEE Certified Software Development Professional (CSDP)
Computer Scientist
Code 474300D
1 Administration Circle. M/S 1109
China Lake, CA 93555
daniel.bea...@navy.mil
(760)939-7097 




-Original Message-
From: webobjects-dev-bounces+daniel.beatty=navy@lists.apple.com 
[mailto:webobjects-dev-bounces+daniel.beatty=navy@lists.apple.com] On 
Behalf Of Yoann Canal
Sent: Tuesday, August 11, 2015 1:52 AM
To: Dennis Bliefernicht; WebObjects Development
Subject: Re: Gradle and Eclipse

Hi Dennis and thanks for your reply.

On 11/08/15 08:49, Dennis Bliefernicht wrote:


Hi, 


On 10 Aug 2015, at 16:25, Yoann Canal  
mailto:yca...@sophiacom.fr yca...@sophiacom.fr wrote:

Hi all,

After the WOWODC and Dennis' talk, we started to migrate our 
build system to use gradle.
The build works well on our staging servers. We had to modify 
the gradle-wonder-plugin to fit our needs
and might issue a pull request if someone is interested.



Always welcome :-) Out of curiosity: what kind of changes?


- download woproject.jar only once instead of once per framework
- remove reference to nexus.xyrality.net
- remove postgres dependencies
- allow setting webobjectsVersion / wonderVersion before applying the plugin 
since automatically added frameworks will use the default versions otherwise

Some other stuff that would probably only be of interest to us:
- use a fixed name for the generated tar.gz to have a fixed archive URL in 
Jenkins
- don't resolve wounit dependencies since it gets outdated jars

You can take a look at https://github.com/Sophiacom/gradle-wonder-plugin for 
those changes.


However, we can't run the eclipse projects as generated with 
gradle:
projects are correctly imported and built, tests run fine but 
running the project itself inside eclipse with WOLips results in:

[2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
/Users/ycanal/WebObjects.properties at path: /Users/ycanal
[2015-8-10 16:14:34 CEST] main Unable to initialize 
WOProperties for reason: Cannot find JavaWebObjects framework ! 
java.lang.IllegalStateException: Unable to locate the JavaWebObjects bundle
[2015-8-10 16:14:34 CEST] main A fatal exception occurred: 
WOApplication: Cannot be initialized.
[2015-8-10 16:14:34 CEST] main 
com.webobjects.foundation.NSForwardException [java.lang.IllegalStateException] 
Unable to locate the JavaWebObjects bundle:WOApplication: Cannot be 
initialized.
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
   at 
er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
   at 
er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
   at 
fr.sophiacom.corason.foundation.appserver.COCoreApplication.init(COCoreApplication.java:22)
   at 
fr.sophiacom.app.NRApplication.init(NRApplication.java:19)
   at fr.sophiacom.app.Application.init(Application.java:30)
   at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at 
java.lang.reflect.Constructor.newInstance(Constructor.java:422)
   at java.lang.Class.newInstance(Class.java:442)
   at 
com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
   at 
er.extensions.appserver.ERXApplication.main(ERXApplication.java:866)
   at fr.sophiacom.app.Application.main(Application.java:25)
Caused by: java.lang.IllegalStateException: Unable to locate 
the JavaWebObjects bundle
   at 
com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:131)
   at 
com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
   at 
com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
   at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:779)
   ... 13 more

Do you have any idea how to fix that ?
Right now we are still keeping our old .project / build.xml 
/.classpath but we would like

Gradle and Eclipse

2015-08-10 Thread Yoann Canal

Hi all,

After the WOWODC and Dennis' talk, we started to migrate our build 
system to use gradle.
The build works well on our staging servers. We had to modify the 
gradle-wonder-plugin to fit our needs

and might issue a pull request if someone is interested.

However, we can't run the eclipse projects as generated with gradle:
projects are correctly imported and built, tests run fine but running 
the project itself inside eclipse with WOLips results in:


[2015-8-10 16:14:34 CEST] main Couldn't load properties file: 
/Users/ycanal/WebObjects.properties at path: /Users/ycanal
[2015-8-10 16:14:34 CEST] main Unable to initialize WOProperties for 
reason: Cannot find JavaWebObjects framework ! 
java.lang.IllegalStateException: Unable to locate the JavaWebObjects 
bundle
[2015-8-10 16:14:34 CEST] main A fatal exception occurred: 
WOApplication: Cannot be initialized.
[2015-8-10 16:14:34 CEST] main 
com.webobjects.foundation.NSForwardException 
[java.lang.IllegalStateException] Unable to locate the JavaWebObjects 
bundle:WOApplication: Cannot be initialized.
at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:918)
at 
er.extensions.appserver.ajax.ERXAjaxApplication.init(ERXAjaxApplication.java:30)
at 
er.extensions.appserver.ERXApplication.init(ERXApplication.java:1097)
at 
fr.sophiacom.corason.foundation.appserver.COCoreApplication.init(COCoreApplication.java:22)

at fr.sophiacom.app.NRApplication.init(NRApplication.java:19)
at fr.sophiacom.app.Application.init(Application.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:866)
at fr.sophiacom.app.Application.main(Application.java:25)
Caused by: java.lang.IllegalStateException: Unable to locate the 
JavaWebObjects bundle
at 
com.webobjects.appserver.WOResourceManager.__getJavaWebObjectsResourceAsStream(WOResourceManager.java:131)
at 
com.webobjects.appserver._private.WOProperties.initUserDefaultsKeys(WOProperties.java:317)
at 
com.webobjects.appserver.WOApplication._initWOApp(WOApplication.java:5743)
at 
com.webobjects.appserver.WOApplication.init(WOApplication.java:779)

... 13 more

Do you have any idea how to fix that ?
Right now we are still keeping our old .project / build.xml /.classpath 
but we would like to avoid maintaining 2 configurations.


Thanks for your help,
Yoann

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com