You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Putrycz, Erik" <Er...@nrc-cnrc.gc.ca> on 2006/07/18 01:00:57 UTC

JCI, JDT and Tomcat/JBoss

I've been having some issues lately with JBoss Rules running inside JBoss AS. JBoss Rules uses JCI as backend for compiling the rules.

The JDT plugin for JCI is compiled against the version 3.2 of JDT but JBoss and Tomcat contain version 3.1 of JDT.

I downloaded all the SVN sources from the trunk and I copied and modified the eclipse project. The modified eclipse project compiles all fine without any source code change with JDT 3.1 and by using the obtained jar JBoss Rules seems to work fine in JBoss AS. 

I'd be willing to contribute to JCI and to add out of the box compilation with Tomcat with a plugin.

Would anyone be interested?

Erik Putrycz, Ph.D - Research Associate / erik.putrycz@nrc-cnrc.gc.ca / (613) 990 0681
Institute for Information Technology - Software Engineering Group
National Research Council, Canada - Building M-50, 1200 Montreal Road
Ottawa, Ontario, CANADA K1A 0R6


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: RE: RE: [JCI] RE: JCI, JDT and Tomcat/JBoss

Posted by Torsten Curdt <tc...@apache.org>.
Sorry for the late reply...

> The maven dependency I found is
>     <dependency>
>       <groupId>tomcat</groupId>
>       <artifactId>jasper-compiler-jdt</artifactId>
>       <version>5.5.12</version>
>     </dependency>

Uh ...looks like a self-assembled version. Not nice. I would give it
go with jardiff and see how much it differs from the original jar.

> Don't ask me how I found it, I just made a search using the maven
> eclipse plugin, except that, I'm not too maven fluent.

At least you found it :)

> The mock + abstract test classes sounds very good to me.

Yeah ...but the abstract test classes are just a bit of pain with the
current project structure.

> I just started writing some compiler specific tests but I did not notice
> that the main directory has tests in the "test" directory.
> Is there any way to import these tests into Eclipse?

You mean the test module? Sure ...what's your problem exactly?

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: RE: [JCI] RE: JCI, JDT and Tomcat/JBoss

Posted by "Putrycz, Erik" <Er...@nrc-cnrc.gc.ca>.
The maven dependency I found is 
    <dependency>
      <groupId>tomcat</groupId>
      <artifactId>jasper-compiler-jdt</artifactId>
      <version>5.5.12</version>
    </dependency>

Don't ask me how I found it, I just made a search using the maven
eclipse plugin, except that, I'm not too maven fluent.

The mock + abstract test classes sounds very good to me. 

I just started writing some compiler specific tests but I did not notice
that the main directory has tests in the "test" directory.
Is there any way to import these tests into Eclipse?

Cheers

Erik.



-----Original Message-----
From: tcurdt@gmail.com [mailto:tcurdt@gmail.com] On Behalf Of Torsten
Curdt
Sent: July 19, 2006 4:48
To: Jakarta Commons Developers List
Subject: Re: RE: [JCI] RE: JCI, JDT and Tomcat/JBoss


> Concerning the statics, I was referring to the INSTANCE in 
> JavaCompilerFactory. The instance has a class cache which could 
> potentially lead to non-garbageable stuff.

Well, the usual singleton ...should be alright. But I am not religious
on that one.

> Also concerning the versions, what I did is use the tomcat JDT in the 
> maven dependencies. I'm not even 100% if it is a vanilla 3.1 JDT.

Hm... what else should/could it be?

> Btw, what about moving some of the tests into each compiler project? 
> This way there wouldn't be any issues having 2 different projects.

We could write abstract compiler tests and then extend (implement) them
in the individual compilers. Sure. At the moment the compiler bridge
code is not tested itself.  What is getting tested is currently only in
core.

...and we are using a compiler implementation to do testing of the core.
(At least at the moment) Which makes things a bit ugly. So the testing
setup is not perfect at the moment ....but I am happy to suggestions.

The only idea I have is to mock a compiler in core and then do the real
tests in the individual compiler projects ...based on an common abstract
test code.

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: RE: [JCI] RE: JCI, JDT and Tomcat/JBoss

Posted by Torsten Curdt <tc...@apache.org>.
> Concerning the statics, I was referring to the INSTANCE in
> JavaCompilerFactory. The instance has a class cache which could
> potentially lead to non-garbageable stuff.

Well, the usual singleton ...should be alright. But I am not religious
on that one.

> Also concerning the versions, what I did is use the tomcat JDT in the
> maven dependencies. I'm not even 100% if it is a vanilla 3.1 JDT.

Hm... what else should/could it be?

> Btw, what about moving some of the tests into each compiler project?
> This way there wouldn't be any issues having 2 different projects.

We could write abstract compiler tests and then extend (implement)
them in the individual compilers. Sure. At the moment the compiler
bridge code is not tested itself.  What is getting tested is currently
only in core.

...and we are using a compiler implementation to do testing of the
core. (At least at the moment) Which makes things a bit ugly. So the
testing setup is not perfect at the moment ....but I am happy to
suggestions.

The only idea I have is to mock a compiler in core and then do the
real tests in the individual compiler projects ...based on an common
abstract test code.

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [JCI] RE: JCI, JDT and Tomcat/JBoss

Posted by "Putrycz, Erik" <Er...@nrc-cnrc.gc.ca>.
Concerning the statics, I was referring to the INSTANCE in
JavaCompilerFactory. The instance has a class cache which could
potentially lead to non-garbageable stuff.

Also concerning the versions, what I did is use the tomcat JDT in the
maven dependencies. I'm not even 100% if it is a vanilla 3.1 JDT.

Btw, what about moving some of the tests into each compiler project?
This way there wouldn't be any issues having 2 different projects.

Erik.

-----Original Message-----
From: tcurdt@gmail.com [mailto:tcurdt@gmail.com] On Behalf Of Torsten
Curdt
Sent: July 18, 2006 13:49
To: Jakarta Commons Developers List
Subject: Re: [JCI] RE: JCI, JDT and Tomcat/JBoss


> I believe the compiler links somehow to a particular version of an 
> interface... Even if the methods signatures are the same, if the 
> interface is different, I'm not sure it links correctly.

That sounds rather bizarre to me ...I will investigate a bit

> The error I had with JDT 3.1 was
> java.lang.NoSuchMethodError: 
> org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg
> /e
> clipse/jdt/core/compiler/CategorizedProblem;

Thanks for the pointer

> What I'm not sure is what would be the best way to solve it... Just 
> add a different compiled version of the eclipse plug-in or create a 
> different plug-in?

My initial idea was to have one codebase with a detached release cycle
for the the compiler modules. So we would have a 3.1 and a 3.2 branch of
the plugin.

> The problem in making a different compiled version is that it won't be

> easy to run the test suites against both versions.

But you are right testing-wise it would be not that perfect . On the
other hand ...if you consider them different artifacts ...don't know

> It would be nice to
> create different classes and maybe have a way to select inside JCI the

> appropriate version.

Problem is that a 3.1 and a 3.2 compiler most likely won't work in the
same classpath.

> Btw, another change I would suggest in JCI is to remove all static 
> caches.

Can you elaborate what you are referring to? Not aware of any statics
...execept the singleton instances.

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [JCI] RE: JCI, JDT and Tomcat/JBoss

Posted by Torsten Curdt <tc...@apache.org>.
> I believe the compiler links somehow to a particular version of an
> interface... Even if the methods signatures are the same, if the
> interface is different, I'm not sure it links correctly.

That sounds rather bizarre to me ...I will investigate a bit

> The error I had with JDT 3.1 was
> java.lang.NoSuchMethodError:
> org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/e
> clipse/jdt/core/compiler/CategorizedProblem;

Thanks for the pointer

> What I'm not sure is what would be the best way to solve it... Just add
> a different compiled version of the eclipse plug-in or create a
> different plug-in?

My initial idea was to have one codebase with a detached release cycle
for the the compiler modules. So we would have a 3.1 and a 3.2 branch
of the plugin.

> The problem in making a different compiled version is that it won't be
> easy to run the test suites against both versions.

But you are right testing-wise it would be not that perfect . On the
other hand ...if you consider them different artifacts ...don't know

> It would be nice to
> create different classes and maybe have a way to select inside JCI the
> appropriate version.

Problem is that a 3.1 and a 3.2 compiler most likely won't work in the
same classpath.

> Btw, another change I would suggest in JCI is to remove all static
> caches.

Can you elaborate what you are referring to? Not aware of any statics
...execept the singleton instances.

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[JCI] RE: JCI, JDT and Tomcat/JBoss

Posted by "Putrycz, Erik" <Er...@nrc-cnrc.gc.ca>.
I believe the compiler links somehow to a particular version of an
interface... Even if the methods signatures are the same, if the
interface is different, I'm not sure it links correctly.

The error I had with JDT 3.1 was 
java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/e
clipse/jdt/core/compiler/CategorizedProblem;

What I'm not sure is what would be the best way to solve it... Just add
a different compiled version of the eclipse plug-in or create a
different plug-in?
The problem in making a different compiled version is that it won't be
easy to run the test suites against both versions. It would be nice to
create different classes and maybe have a way to select inside JCI the
appropriate version.

Btw, another change I would suggest in JCI is to remove all static
caches. Static caches can cause memory leaks in webapps because of the
different classloaders involved... Although this seems to me unlikely to
happen with JCI, I don't think there would be much loss of functionality
by removing them.


Cheers,

Erik Putrycz, Ph.D - Research Associate / erik.putrycz@nrc-cnrc.gc.ca /
(613) 990 0681
Institute for Information Technology - Software Engineering Group
National Research Council, Canada - Building M-50, 1200 Montreal Road
Ottawa, Ontario, CANADA K1A 0R6

-----Original Message-----
From: tcurdt@gmail.com [mailto:tcurdt@gmail.com] On Behalf Of Torsten
Curdt
Sent: July 18, 2006 5:03
To: Jakarta Commons Developers List
Subject: Re: JCI, JDT and Tomcat/JBoss

> I've been having some issues lately with JBoss Rules running inside
JBoss AS. JBoss Rules uses JCI as backend for compiling the rules.
>
> The JDT plugin for JCI is compiled against the version 3.2 of JDT but
JBoss and Tomcat contain version 3.1 of JDT.

Sure no change is needed? Strange it does not work with the compiled
jci module then :-/ I've already talked with Mark about his ...we
might need a dedicated 3.1 module then. But I first I'd like to find
out why exactly.

What error did you get?

> I downloaded all the SVN sources from the trunk and I copied and
modified the eclipse project. The modified eclipse project compiles all
fine without any source code change with JDT 3.1 and by using the
obtained jar JBoss Rules seems to work fine in JBoss AS.

Great

> I'd be willing to contribute to JCI and to add out of the box
compilation with Tomcat with a plugin.
>
> Would anyone be interested?

Any help is appreciated...

What do you mean by "out of the box compilation with Tomcat" ? You
mean work out of the box with eclipse 3.1?

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: JCI, JDT and Tomcat/JBoss

Posted by Torsten Curdt <tc...@apache.org>.
> I've been having some issues lately with JBoss Rules running inside JBoss AS. JBoss Rules uses JCI as backend for compiling the rules.
>
> The JDT plugin for JCI is compiled against the version 3.2 of JDT but JBoss and Tomcat contain version 3.1 of JDT.

Sure no change is needed? Strange it does not work with the compiled
jci module then :-/ I've already talked with Mark about his ...we
might need a dedicated 3.1 module then. But I first I'd like to find
out why exactly.

What error did you get?

> I downloaded all the SVN sources from the trunk and I copied and modified the eclipse project. The modified eclipse project compiles all fine without any source code change with JDT 3.1 and by using the obtained jar JBoss Rules seems to work fine in JBoss AS.

Great

> I'd be willing to contribute to JCI and to add out of the box compilation with Tomcat with a plugin.
>
> Would anyone be interested?

Any help is appreciated...

What do you mean by "out of the box compilation with Tomcat" ? You
mean work out of the box with eclipse 3.1?

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org