Skip to main content
gamedev.net
🔒 Locked

[java] Missing import problem and JAX-WS 2.0

Started by Mulligan 2 replies 6.9k views
Original Post
Mulligan
Mulligan
I'm attempting to compile a project that uses generated .java files created by JAX-WS 2.0. The compile goes fine, but when I add the .java files to my project, I get the error message: C:\Documents and Settings\ddonahoe\Desktop\project\JavaApplication8\src\javaapplication8\TrimCT\AddLocationRelationship.java:4: package javax.xml.bind.annotation does not exist when i hover over the error, the tooltip "javax.xml.bind cannot be resolved". Only the "javax.xml.bind" part of the import statement is highlighted too. I pretty much still suck at java at this point, but any ideas on how to fix this problem?> Thanks
daireq
daireq

You're missing the JAXB jars in your classpath (JWSP_HOME/jaxb/lib). Its been a while since I've set up a JWSDP project so can't recall this exactly, you might -also- need the activation.jar from the jwsdp common directory.

I ordinarily use Eclipse as a dev environment, I've set up hundreds of custom user libraries containing bunches of jars that are used for various components we link in to. I have about 4 or five distinct ones for JWSDP including a JAXB one, a JAXRPC one etc etc. Whenever I start off something new its a fairly simple matter just to import whatever user libraries I need into the project.

D.
Mulligan
Mulligan
Pretty sure you're right about that, but because I'm new to all this java buisness with eclipse, How would I add that classpath?

I found the folder:

C:\Sun\jwsdp-2.0\work\forappserver9\for-jaxwsa\javax\xml\bind\annotation

Which contains lots of class files like AccessorOrder.class, which is a class I need.

I *think* that once I can get it to recognize those files it should work, but i'm still used to eclipse and dont know how.


Thanks again
daireq
daireq

Looks like you've un-jarred the class files at some point. This is a bad idea. Grab the original jars or just unzip your original JWSDP installer somewhere, then add those jars to the build path of the project in ecplise. Alternatively, If you're using ant or maven or whatever to do the builds, add them into the scripts classpath.

simplest way to do it in eclipse is to open your projects properties, go to the 'libraries' tab in the 'java build path' dialog and click on 'add external jars'

D.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.