Weblogic/IntelliJ/Ant conflict?

C

Charles Tryon

I've been hunting all over the place for this one and have come up empty...

I have been using IntelliJ IDEA v4.x to build a BEA/Weblogic (v8.1) Web
services application, and found that it works very well. I have a large
ANT task (build.xml) which defines various build and deploy tasks. Some
of the tasks use BEA specific extensions (taskdef tags) to build various
components. The way I've found to get this to work is to include the
weblogic and webservices JAR files in the "Additional Classes" tab on
the build preferences. Life is wonderful. Life is grand.

Then I upgrade to IntelliJ IDEA 5.0.3. *BOOM*

Everything in IntelliJ works just fine, except that any and all ANT
tasks immediately exit with a "success" status with no explaination as
to what they may or may have done. No error logs or anything.

I finally trace it back to the webservices.jar file which contains the
required classes for the taskref definition. If I take this jar file
out, it runs ANT, but fails with a "Class not found" error. If I put it
back in, it just exits. Note that this is NOT a problem in the older
IntelliJ 4.x (or even in some of the EAP builds between 4 and 5).

Any idea what might be going on, and how I might be able to get around
this problem in IntelliJ?
 
B

Brandon McCombs

Charles said:
I've been hunting all over the place for this one and have come up empty...

I have been using IntelliJ IDEA v4.x to build a BEA/Weblogic (v8.1) Web
services application, and found that it works very well. I have a large
ANT task (build.xml) which defines various build and deploy tasks. Some
of the tasks use BEA specific extensions (taskdef tags) to build various
components. The way I've found to get this to work is to include the
weblogic and webservices JAR files in the "Additional Classes" tab on
the build preferences. Life is wonderful. Life is grand.

Then I upgrade to IntelliJ IDEA 5.0.3. *BOOM*

Everything in IntelliJ works just fine, except that any and all ANT
tasks immediately exit with a "success" status with no explaination as
to what they may or may have done. No error logs or anything.

I finally trace it back to the webservices.jar file which contains the
required classes for the taskref definition. If I take this jar file
out, it runs ANT, but fails with a "Class not found" error. If I put it
back in, it just exits. Note that this is NOT a problem in the older
IntelliJ 4.x (or even in some of the EAP builds between 4 and 5).

Any idea what might be going on, and how I might be able to get around
this problem in IntelliJ?

Did you pay for support for intelliJ?
 
E

EricF

I've been hunting all over the place for this one and have come up empty...

I have been using IntelliJ IDEA v4.x to build a BEA/Weblogic (v8.1) Web
services application, and found that it works very well. I have a large
ANT task (build.xml) which defines various build and deploy tasks. Some
of the tasks use BEA specific extensions (taskdef tags) to build various
components. The way I've found to get this to work is to include the
weblogic and webservices JAR files in the "Additional Classes" tab on
the build preferences. Life is wonderful. Life is grand.

Then I upgrade to IntelliJ IDEA 5.0.3. *BOOM*

Everything in IntelliJ works just fine, except that any and all ANT
tasks immediately exit with a "success" status with no explaination as
to what they may or may have done. No error logs or anything.

I finally trace it back to the webservices.jar file which contains the
required classes for the taskref definition. If I take this jar file
out, it runs ANT, but fails with a "Class not found" error. If I put it
back in, it just exits. Note that this is NOT a problem in the older
IntelliJ 4.x (or even in some of the EAP builds between 4 and 5).

Any idea what might be going on, and how I might be able to get around
this problem in IntelliJ?

This is not so much an Intellij issue (great IDE), it's an Ant issue. I think.

BEA has their own version of Ant that have the BEA tags defined. (Functionally
they work that way - I've never really looked at them).

You might be able to replace the ant that Intellij provides with BEA's. I
don't typically use ant in Idea to do my build's - but there is an option to
not use the bundled ant.

Personally I don't like being tied to BEA's ant. So in my build files, I have
the taskdefs I need. It sounds like you may be doing this but here's my
servicegen definition as an example ...

<!-- Define the WL servicegen task -->
<taskdef
name="servicegen"
classpathref="weblogic.webservices.classpath"

classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"
/>

The weblogic.webservices.classpath points to weblogic.jar and webservices,jar,
as well as the jdk tools.jar ...

<!--classpath for web service tasks -->
<path id="weblogic.webservices.classpath">
<fileset dir="${wl.home}/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${java.home}/lib/tools.jar"/>
</path>

This works fine for me - but I do my builds from the command line.

I suspect you'd be better off defining the weblogic specific jars in the
build.xml file instead of the Ide build preferences. But I may be wrong. And
note that tools.jar is in the classpath.

Hopefully I've given enough tips that you can figure out the problem.

Some advice: Get a build script that works from the command line. Once that is
done, I would think you could run the same script from Idea.

HTH

Eric
 
C

Charles Tryon

Eric,

Thanks -- I haven't tried this yet, but you've filled in some holes
in what I was trying to do but couldn't figure out. You are absolutely
correct about the command line, but unfortunately, I inherited this very
big and complex project, so I'm not always able to do what I would LIKE
to do.

I *DID* get a reply from IntelliJ, and I wanted to share it here as it
sheds more light on the situation:

= = = = = = = = = = =
It's a well known problem. Ant 1.6 is not compatible with Ant
1.5 taskdefs defined in optional.jar file. For some unknown reason the
optional taskdefs from Ant 1.5 optional.jar are included into
weblogic.jar and it leads to the problem.

Workarounds:

- Configure your build to run under Ant 1.5
- Delete Ant 1.5 optional taskdef packages from the jars which are in
the Ant's classpath

See comments to this issue: http://jetbrains.net/jira/browse/IDEA-4317
= = = = = = = = = = =

So, I'm not sure if I have a solution yet, but I know better what is
going on, and I have a couple of things to try. Thanks to all!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top