Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Bilgin Ibryam
Hi Adam,

Ant tasks (tried with clean-all run-install) don't work. The error I get
is:

ofbiz/macros.xml:58: Unable to load a script engine manager
(org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)


Bilgin

On Wed, 2008-10-29 at 03:22 +0000, [hidden email] wrote:

> Author: doogie
> Date: Tue Oct 28 20:22:05 2008
> New Revision: 708760
>
> URL: http://svn.apache.org/viewvc?rev=708760&view=rev
> Log:
> Finish feature integration; the ofbiz-jjtree task now works.
>
> Modified:
>     ofbiz/trunk/framework/base/ant-scripts/ofbiz-jjtree.groovy
>     ofbiz/trunk/macros.xml
>
> Modified: ofbiz/trunk/framework/base/ant-scripts/ofbiz-jjtree.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/ant-scripts/ofbiz-jjtree.groovy?rev=708760&r1=708759&r2=708760&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/base/ant-scripts/ofbiz-jjtree.groovy (original)
> +++ ofbiz/trunk/framework/base/ant-scripts/ofbiz-jjtree.groovy Tue Oct 28 20:22:05 2008
> @@ -19,8 +19,8 @@
>  
>  import org.apache.tools.ant.BuildException
>  
> -def resolveFile = { name ->
> -    return project.resolveFile(project.replaceProperties(name))
> +def resolveFile = { name, base ->
> +    return project.resolveFile(project.replaceProperties(name), base)
>  }
>  
>  def getAttribute = { name, defaultValue ->
> @@ -40,19 +40,35 @@
>  }
>  
>  def ant = new AntBuilder(self)
> -def javacchome = resolveFile('${ofbiz.home.dir}/framework/base/lib/javacc')
> +def javacchome = resolveFile('${ofbiz.home.dir}/framework/base/lib/javacc', null)
>  def src = getAttribute('src', 'src')
>  def dir = getAttribute('dir', null)
>  def file = getAttribute('file', null)
> -def srcfile = resolveFile("$src/$dir/${file}.jjt")
> +def srcfile = resolveFile("$src/$dir/${file}.jjt", null)
> +def srcpaths = [
> +    jjtree:     resolveFile(getAttribute('gendir', '${build.dir}/gen-src') + '/jjtree/', null),
> +    javacc:     resolveFile(getAttribute('gendir', '${build.dir}/gen-src') + '/javacc/', null),
> +]
>  def dirs = [
> -    jjtree:     resolveFile(getAttribute('gendir', '${build.dir}/gen-src') + '/jjtree/' + dir),
> -    javacc:     resolveFile(getAttribute('gendir', '${build.dir}/gen-src') + '/javacc/' + dir),
> +    jjtree:     resolveFile(dir, srcpaths.jjtree),
> +    javacc:     resolveFile(dir, srcpaths.javacc),
>  ]
>  def gen = [
>      jjfile:     new File(dirs.jjtree, project.replaceProperties("${file}.jj")),
>      javafile:   new File(dirs.javacc, project.replaceProperties("${file}.java")),
>  ]
> +def srcpath = project.getReference('src-path')
> +def foundpath = [
> +    jjtree:     false,
> +    javacc:     false,
> +]
> +srcpath.each {
> +    foundpath.jjtree |= it.file == srcpaths.jjtree
> +    foundpath.javacc |= it.file == srcpaths.javacc
> +}
> +if (!foundpath.jjtree) srcpath.append(ant.path{pathelement(location: srcpaths.jjtree)})
> +if (!foundpath.javacc) srcpath.append(ant.path{pathelement(location: srcpaths.javacc)})
> +
>  if (!uptodate(srcfile, gen.jjfile)) {
>      ant.delete(dir:dirs.jjtree)
>      ant.mkdir(dir:dirs.jjtree)
> @@ -71,5 +87,5 @@
>          javacchome:         javacchome,
>          outputdirectory:    dirs.javacc,
>      )
> -    ant.delete(dir:resolveFile('${build.classes}/' + dir))
> +    ant.delete(dir:resolveFile('${build.classes}/' + dir, null))
>  }
>
> Modified: ofbiz/trunk/macros.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/macros.xml?rev=708760&r1=708759&r2=708760&view=diff
> ==============================================================================
> --- ofbiz/trunk/macros.xml (original)
> +++ ofbiz/trunk/macros.xml Tue Oct 28 20:22:05 2008
> @@ -30,6 +30,8 @@
>    </sequential>
>   </macrodef>
>  
> + <path id="src-path"/>
> +
>   <path id="groovy.class.path">
>    <pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/groovy-1.5.6.jar"/>
>    <pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/asm-2.2.jar"/>
> @@ -42,11 +44,11 @@
>   </presetdef>
>  
>   <presetdef name="javac14">
> -  <default-javac compiler="javac1.4" target="1.4" source="1.4" encoding="UTF-8"/>
> +  <default-javac compiler="javac1.4" target="1.4" source="1.4" encoding="UTF-8" sourcepathref="src-path"/>
>   </presetdef>
>  
>   <presetdef name="javac15">
> -  <default-javac compiler="javac1.5" target="1.5" source="1.5" encoding="UTF-8">
> +  <default-javac compiler="javac1.5" target="1.5" source="1.5" encoding="UTF-8" sourcepathref="src-path">
>     <!--
>     <compilerarg value="-Xlint:unchecked"/>
>     -->
>
>

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Ray-91
Getting a similar problem on Windows XP machine, Ubuntu PC is carrying
on happily enough. Have both machines running JDK 1.6.

\ofbiz_apache_clean_test\macros.xml:58: Problem: failed to create task
or type scriptdef
Cause: the class org.apache.tools.ant.taskdefs.optional.script.ScriptDef
was not found.

Ray


 ----- Forwarded Message ----
 From: Bilgin Ibryam <[hidden email]
 To: [hidden email]
 Sent: Wednesday, 29 October, 2008 8:58:38 AM
 Subject: Re: svn commit: r708760 - in /ofbiz/trunk:
 framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

 Hi Adam,

 Ant tasks (tried with clean-all run-install) don't work. The error I get
 is:

 ofbiz/macros.xml:58: Unable to load a script engine manager
 (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)


 Bilgin

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Ray-91
Seems like a missing ant jar from ofbiz framework:
   ant-nodeps.jar
so depends on your computer set up as to whether current trunk will
build. If you have ant installed else where and it's in your path it'll
probably work, otherwise you'll need to get this jar from ant.

Should probably be added to framework/base/lib

Ray


>  ----- Forwarded Message ----
>  From: Bilgin Ibryam <[hidden email]
>  To: [hidden email]
>  Sent: Wednesday, 29 October, 2008 8:58:38 AM
>  Subject: Re: svn commit: r708760 - in /ofbiz/trunk:
>  framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml
>
>  Hi Adam,
>
>  Ant tasks (tried with clean-all run-install) don't work. The error I get
>  is:
>
>  ofbiz/macros.xml:58: Unable to load a script engine manager
>  (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)
>
>
>  Bilgin
>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Ray-91
OK looks like more than one problem!

The first problem I experienced was related to missing ant-nodeps.jar,
but then still had problems when using 1.5 jdk. Needed to add:
  bsf-2.4.0.jar
  ant-apache-bsf.jar
to the macros.xml. patch sample below but it uses ant 1.7.1 so has a few
other changes to the standard. Probably ant 1.7.0 will work its just I
didn't have it to hand so pulled the latest.

Sorry email might have changed formatting of below patch and you'll need
to get the jars until someone with framework privs sorts it.

Ray



Index: ant.bat
===================================================================
--- ant.bat (revision 708851)
+++ ant.bat (working copy)
@@ -19,5 +19,5 @@
 REM #####################################################################
 ECHO ON

-"%JAVA_HOME%\bin\java" -jar framework/base/lib/ant-launcher-1.7.0.jar
%1 %2 %3 %4 %5 %6
+"%JAVA_HOME%\bin\java" -jar framework/base/lib/ant-launcher-1.7.1.jar
%1 %2 %3 %4 %5 %6

Index: macros.xml
===================================================================
--- macros.xml (revision 708851)
+++ macros.xml (working copy)
@@ -36,6 +36,8 @@
   <pathelement
location="${ofbiz.home.dir}/framework/base/lib/scripting/groovy-1.5.6.jar"/>
   <pathelement
location="${ofbiz.home.dir}/framework/base/lib/scripting/asm-2.2.jar"/>
   <pathelement
location="${ofbiz.home.dir}/framework/base/lib/scripting/antlr-2.7.6.jar"/>
+  <pathelement
location="${ofbiz.home.dir}/framework/base/lib/scripting/bsf-2.4.0.jar"/>
+  <pathelement
location="${ofbiz.home.dir}/framework/base/lib/scripting/ant-apache-bsf-1.7.1.jar"/>
  </path>
  <path id="local.class.path"/>




Ray wrote:

> Seems like a missing ant jar from ofbiz framework:
>    ant-nodeps.jar
> so depends on your computer set up as to whether current trunk will
> build. If you have ant installed else where and it's in your path it'll
> probably work, otherwise you'll need to get this jar from ant.
>
> Should probably be added to framework/base/lib
>
> Ray
>
>
>>  ----- Forwarded Message ----
>>  From: Bilgin Ibryam <[hidden email]
>>  To: [hidden email]
>>  Sent: Wednesday, 29 October, 2008 8:58:38 AM
>>  Subject: Re: svn commit: r708760 - in /ofbiz/trunk:
>>  framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml
>>
>>  Hi Adam,
>>
>>  Ant tasks (tried with clean-all run-install) don't work. The error I get
>>  is:
>>
>>  ofbiz/macros.xml:58: Unable to load a script engine manager
>>  (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)
>>
>>
>>  Bilgin
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Tim Ruppert
Either roll back the changes or let's fix them.  Going to bed with a  
broken build is bad form :)

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

On Oct 29, 2008, at 6:48 AM, Ray wrote:

> OK looks like more than one problem!
>
> The first problem I experienced was related to missing ant-nodeps.jar,
> but then still had problems when using 1.5 jdk. Needed to add:
>  bsf-2.4.0.jar
>  ant-apache-bsf.jar
> to the macros.xml. patch sample below but it uses ant 1.7.1 so has a  
> few
> other changes to the standard. Probably ant 1.7.0 will work its just I
> didn't have it to hand so pulled the latest.
>
> Sorry email might have changed formatting of below patch and you'll  
> need
> to get the jars until someone with framework privs sorts it.
>
> Ray
>
>
>
> Index: ant.bat
> ===================================================================
> --- ant.bat (revision 708851)
> +++ ant.bat (working copy)
> @@ -19,5 +19,5 @@
> REM  
> #####################################################################
> ECHO ON
>
> -"%JAVA_HOME%\bin\java" -jar framework/base/lib/ant-launcher-1.7.0.jar
> %1 %2 %3 %4 %5 %6
> +"%JAVA_HOME%\bin\java" -jar framework/base/lib/ant-launcher-1.7.1.jar
> %1 %2 %3 %4 %5 %6
>
> Index: macros.xml
> ===================================================================
> --- macros.xml (revision 708851)
> +++ macros.xml (working copy)
> @@ -36,6 +36,8 @@
>   <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> groovy-1.5.6.jar"/>
>   <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> asm-2.2.jar"/>
>   <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> antlr-2.7.6.jar"/>
> +  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> bsf-2.4.0.jar"/>
> +  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/ant-apache-
> bsf-1.7.1.jar"/>
>  </path>
>  <path id="local.class.path"/>
>
>
>
>
> Ray wrote:
>> Seems like a missing ant jar from ofbiz framework:
>>   ant-nodeps.jar
>> so depends on your computer set up as to whether current trunk will
>> build. If you have ant installed else where and it's in your path  
>> it'll
>> probably work, otherwise you'll need to get this jar from ant.
>>
>> Should probably be added to framework/base/lib
>>
>> Ray
>>
>>
>>> ----- Forwarded Message ----
>>> From: Bilgin Ibryam <[hidden email]
>>> To: [hidden email]
>>> Sent: Wednesday, 29 October, 2008 8:58:38 AM
>>> Subject: Re: svn commit: r708760 - in /ofbiz/trunk:
>>> framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml
>>>
>>> Hi Adam,
>>>
>>> Ant tasks (tried with clean-all run-install) don't work. The error  
>>> I get
>>> is:
>>>
>>> ofbiz/macros.xml:58: Unable to load a script engine manager
>>> (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)
>>>
>>>
>>> Bilgin
>>>
>>>
>>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Adam Heath-2
Tim Ruppert wrote:
> Either roll back the changes or let's fix them.  Going to bed with a
> broken build is bad form :)

Didn't go to bed with it broken; my global ant got support for this a
long time ago(bsf).

I tested each of these changes in clean checkout, clean-all,
run-install, run-tests.  But now that I know, I can make it work for others.
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Tim Ruppert
In reply to this post by Ray-91
Either roll back the changes or let's fix them.  Going to bed with a  
broken build is bad form :)

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

On Oct 29, 2008, at 6:48 AM, Ray wrote:

> OK looks like more than one problem!
>
> The first problem I experienced was related to missing ant-nodeps.jar,
> but then still had problems when using 1.5 jdk. Needed to add:
> bsf-2.4.0.jar
> ant-apache-bsf.jar
> to the macros.xml. patch sample below but it uses ant 1.7.1 so has a  
> few
> other changes to the standard. Probably ant 1.7.0 will work its just I
> didn't have it to hand so pulled the latest.
>
> Sorry email might have changed formatting of below patch and you'll  
> need
> to get the jars until someone with framework privs sorts it.
>
> Ray
>
>
>
> Index: ant.bat
> ===================================================================
> --- ant.bat (revision 708851)
> +++ ant.bat (working copy)
> @@ -19,5 +19,5 @@
> REM  
> #####################################################################
> ECHO ON
>
> -"%JAVA_HOME%\bin\java" -jar framework/base/lib/ant-launcher-1.7.0.jar
> %1 %2 %3 %4 %5 %6
> +"%JAVA_HOME%\bin\java" -jar framework/base/lib/ant-launcher-1.7.1.jar
> %1 %2 %3 %4 %5 %6
>
> Index: macros.xml
> ===================================================================
> --- macros.xml (revision 708851)
> +++ macros.xml (working copy)
> @@ -36,6 +36,8 @@
>  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> groovy-1.5.6.jar"/>
>  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> asm-2.2.jar"/>
>  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> antlr-2.7.6.jar"/>
> +  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/
> bsf-2.4.0.jar"/>
> +  <pathelement
> location="${ofbiz.home.dir}/framework/base/lib/scripting/ant-apache-
> bsf-1.7.1.jar"/>
> </path>
> <path id="local.class.path"/>
>
>
>
>
> Ray wrote:
>> Seems like a missing ant jar from ofbiz framework:
>>  ant-nodeps.jar
>> so depends on your computer set up as to whether current trunk will
>> build. If you have ant installed else where and it's in your path  
>> it'll
>> probably work, otherwise you'll need to get this jar from ant.
>>
>> Should probably be added to framework/base/lib
>>
>> Ray
>>
>>
>>> ----- Forwarded Message ----
>>> From: Bilgin Ibryam <[hidden email]
>>> To: [hidden email]
>>> Sent: Wednesday, 29 October, 2008 8:58:38 AM
>>> Subject: Re: svn commit: r708760 - in /ofbiz/trunk:
>>> framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml
>>>
>>> Hi Adam,
>>>
>>> Ant tasks (tried with clean-all run-install) don't work. The error  
>>> I get
>>> is:
>>>
>>> ofbiz/macros.xml:58: Unable to load a script engine manager
>>> (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)
>>>
>>>
>>> Bilgin
>>>
>>>
>>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Tim Ruppert
In reply to this post by Adam Heath-2
Didn't mean to send that message twice.  As far as the ant update -  
that kinda stuff definitely bites you - any way we can get it in there  
so it doesn't cause anyone strife again later?

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

On Oct 29, 2008, at 8:46 AM, Adam Heath wrote:

> Tim Ruppert wrote:
>> Either roll back the changes or let's fix them.  Going to bed with a
>> broken build is bad form :)
>
> Didn't go to bed with it broken; my global ant got support for this a
> long time ago(bsf).
>
> I tested each of these changes in clean checkout, clean-all,
> run-install, run-tests.  But now that I know, I can make it work for  
> others.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Adam Heath-2
Tim Ruppert wrote:
> Didn't mean to send that message twice.  As far as the ant update - that
> kinda stuff definitely bites you - any way we can get it in there so it
> doesn't cause anyone strife again later?

I also have java 1.6 as my default, so even that keeps this bug from
surfacing.

In any event, I  have it working with the included ./ant shell script;
can't test the .bat.  However, I had to move
framework/base/lib/scripting/bsf-2.4.0.jar up one level, in addition to
adding ant-nodeps.jar.  I'm thinking the move s/b fine, because in all
cases base/lib is already in the classpath for any sub-ant build, or any
running ofbiz, in addition to base/lib/scripting, since ofbiz requires
groovy.
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Tim Ruppert
Hmm - the reason I found this was that the nightly builds broke -  
which are running on 1.5 on a RHEL box.  This happened to break the  
api.ofbiz.org (which just rolled back), but also wanked the demo and  
build sites - so I'm trying to get those back up.

Whenever you're comfy with your update and commit - I'll test this and  
let you know what happened.

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

On Oct 29, 2008, at 9:11 AM, Adam Heath wrote:

> Tim Ruppert wrote:
>> Didn't mean to send that message twice.  As far as the ant update -  
>> that
>> kinda stuff definitely bites you - any way we can get it in there  
>> so it
>> doesn't cause anyone strife again later?
>
> I also have java 1.6 as my default, so even that keeps this bug from
> surfacing.
>
> In any event, I  have it working with the included ./ant shell script;
> can't test the .bat.  However, I had to move
> framework/base/lib/scripting/bsf-2.4.0.jar up one level, in addition  
> to
> adding ant-nodeps.jar.  I'm thinking the move s/b fine, because in all
> cases base/lib is already in the classpath for any sub-ant build, or  
> any
> running ofbiz, in addition to base/lib/scripting, since ofbiz requires
> groovy.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Adam Heath-2
In reply to this post by Adam Heath-2
Adam Heath wrote:
> Tim Ruppert wrote:
>> Didn't mean to send that message twice.  As far as the ant update - that
>> kinda stuff definitely bites you - any way we can get it in there so it
>> doesn't cause anyone strife again later?
>
> I also have java 1.6 as my default, so even that keeps this bug from
> surfacing.
>
> In any event, I  have it working with the included ./ant shell script;

I lied; still has some left-overs being used from the global ant; it
keeps looking in /usr/share/ant/lib.

I'm going to create a fresh chroot.
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r708760 - in /ofbiz/trunk: framework/base/ant-scripts/ofbiz-jjtree.groovy macros.xml

Tim Ruppert
Coolio - thanks Adam.

Cheers,
Tim
--
Tim Ruppert
HotWax Media
http://www.hotwaxmedia.com

o:801.649.6594
f:801.649.6595

On Oct 29, 2008, at 9:27 AM, Adam Heath wrote:

> Adam Heath wrote:
>> Tim Ruppert wrote:
>>> Didn't mean to send that message twice.  As far as the ant update  
>>> - that
>>> kinda stuff definitely bites you - any way we can get it in there  
>>> so it
>>> doesn't cause anyone strife again later?
>>
>> I also have java 1.6 as my default, so even that keeps this bug from
>> surfacing.
>>
>> In any event, I  have it working with the included ./ant shell  
>> script;
>
> I lied; still has some left-overs being used from the global ant; it
> keeps looking in /usr/share/ant/lib.
>
> I'm going to create a fresh chroot.


smime.p7s (3K) Download Attachment