Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 179536 - ant task "script" broken with 1.7.0 apache-bsf
Summary: ant task "script" broken with 1.7.0 apache-bsf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL: http://ant.apache.org/manual/install....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-23 16:13 UTC by Onkobu
Modified: 2007-05-24 20:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Onkobu 2007-05-23 16:13:12 UTC
The URL shows library dependencies. Apache-BSF ebuild depends on Apache-BSF 2.3.x, if one uses Rhino as JavaScript interpreter the oldest eBuild is 1.5.5-r4 which forces usage of Apache-BSF>=2.4.0. Also it's impossible (for me with normal portage usage) to return to rhino 1.5.5-r3.

Using <script>-task in build.xml-s (with language="javascript") raises strange exceptions like NoSuchMethodException or (Ant-)internal messages complaining about misconfiguration.

Reproducible: Always
Comment 1 Onkobu 2007-05-23 17:16:48 UTC
For example (with bsf-2.4.0 emerged):
main:
   [script] 23.05.2007 19:14:27 org.apache.bsf.BSFManager loadScriptingEngine
   [script] SCHWERWIEGEND: Exception :
   [script] java.lang.ClassNotFoundException: org.apache.bsf.engines.javascript.JavaScriptEngine

With (bsf-2.3.x) it's some NoSuchMethodException...and I mean dev-java/bsf, not dev-java/ant-apache-bsf...
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2007-05-23 17:44:19 UTC
(In reply to comment #0)
> 
> Using <script>-task in build.xml-s (with language="javascript") raises strange
> exceptions like NoSuchMethodException or (Ant-)internal messages complaining
> about misconfiguration.
> 

Can you please attach a build.xml for us to test with. Then I can also add it to our test cases repository in http://overlays.gentoo.org/proj/java/browser/testcases/dev-java to make sure it doesn't break with version bumps.
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-05-23 19:27:24 UTC
(In reply to comment #1)
> For example (with bsf-2.4.0 emerged):
> main:
>    [script] 23.05.2007 19:14:27 org.apache.bsf.BSFManager loadScriptingEngine
>    [script] SCHWERWIEGEND: Exception :
>    [script] java.lang.ClassNotFoundException:
> org.apache.bsf.engines.javascript.JavaScriptEngine
> 
> With (bsf-2.3.x) it's some NoSuchMethodException...and I mean dev-java/bsf, not
> dev-java/ant-apache-bsf...

You need to build dev-java/bsf with USE=rhino. Just having rhino installed is not enough. Maybe we should add some einfo or something...
Reproduced this error with USE=-rhino so please rebuild with rhino and report back.

> Can you please attach a build.xml for us to test with. Then I can also add it
> to our test cases repository in
> http://overlays.gentoo.org/proj/java/browser/testcases/dev-java to make sure it
> doesn't break with version bumps.
 
I've added build.xml with two examples from ant manual. If you post your build.xml we can add it too. Tested with both bsf-2.3 and 2.4 and it worked. Although we don't comply with what Ant's manual says, by using bsf-2.3 with rhino 1.5R5 (that's 1.5.5-rX in portage) and not 1.5R3 (which would be 1.5.3, not 1.5.5-r3 BTW). This potential problem can be solved when we get bsf-2.4 stable (too early for this atm). Let's see if your build.xml works with 2.3 after you merge it with rhino flag...

Comment 4 Onkobu 2007-05-24 16:08:52 UTC
(In reply to comment #3)
> I've added build.xml with two examples from ant manual. If you post your
> build.xml we can add it too.

It'd be just something like:

<task name="sometarget">
 <echo message="task sometarget" />
</task> 

<task name="scripttag">
 <script language="javascript">
  sometarget.execute();
 </script>
</task>

Called with 'ant scripttag' it should execute via JavaScript the target 'sometarget'. It works with USE=rhino. Maybe this should be mentioned somewhere in the emerge-log, when installing bsf and ant-apache-bsf.
</task>
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-05-24 20:03:18 UTC
(In reply to comment #4)
> It'd be just something like:
> ...

OK, that's already covered by what I added, nothing more complex, but thanks :)

> 'sometarget'. It works with USE=rhino. Maybe this should be mentioned somewhere
> in the emerge-log, when installing bsf and ant-apache-bsf.
> </task>> 

I've made ant-apache-bsf to check flags of bsf and warn on not being able to run certain <script> tasks accordingly, in ant-apache-bsf-1.7.0-r1