strutstest in Netbeans 6.9

T

Tim Slattery

I'm using JUnit 3.8.2 and Strutstest 2.1.4 to run tests on an
application in Netbeans 6.9.

On test classes that use only JUnit things work just fine. But on the
Struts classes, I get this message:

Absent Code attribute in method that is not native or abstract in
class file javax/servlet//http/HttpServletRequestWrapper

After some googling, I determined that I needed to add a web server,
which I hadn't done. I can't add the Weblogic server that's installed
on my machine, NB just won't do it. So I used the Glassfish server
that comes with NB. Now I still get the message above, and it's also
telling me that it two versions of ant in the page, one in the
NetBeans directory and one in the Glassfish directory.

WTF!?!?!
 
T

Tom Anderson

I'm using JUnit 3.8.2 and Strutstest 2.1.4 to run tests on an
application in Netbeans 6.9.

On test classes that use only JUnit things work just fine. But on the
Struts classes, I get this message:

Absent Code attribute in method that is not native or abstract in
class file javax/servlet//http/HttpServletRequestWrapper

After some googling, I determined that I needed to add a web server,
which I hadn't done. I can't add the Weblogic server that's installed
on my machine, NB just won't do it. So I used the Glassfish server
that comes with NB. Now I still get the message above, and it's also
telling me that it two versions of ant in the page, one in the
NetBeans directory and one in the Glassfish directory.

WTF!?!?!

Have you tried turning it off and on again?

More seriously, have you tried getting a copy of servlet-api.jar (from Sun
or the Glassfish installation you have locally) and adding it to your
classpath?

Are you using maven? From what i've read, the exception you report follows
from the fact that there is an official public maven repository for the
J2EE API which contains invalid classes (seriously, folks - which have
method definitions but no bytecode), and while this is sufficient to
compile against, you can't run with them. I don't know what imbecile came
up with this idea, but they need shooting. I suppose this is a consequence
of the problem that there isn't a standalone binary release of the entire
J2EE API (as opposed to any implementations of it), as there is with the
servlet API. This seems like a shocking omission.

Anyway, getting rid of the maven-derived class files and using the real
things should do the trick. You don't need to include the whole
application (ant and all) in your project, just the individual jars which
the tests need. You'll probably have to find those by trial, error, and
grepping, sadly.

tom
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top