开发者

Moving Axis 1.4 stub project to a Maven based project (Type Access restriction)

For compatibility reasons I have to build Axis 1.4 skeleton classes from exiting an wsdl-file. I use the shipped wsdl2java ant-task from Axis 14.

I'm using MyEclipse 8.5 on Java SDK 1.6.0_18, I added the required libraries to my build path and everything goes fine.

Now I moved my normal project to a Apache Maven2 project, as I added the dependencies I get following warnings (~500):

Description Resource Path Location Type Access restriction: The constructor QName(String, String) is not accessible due to restriction on required library /usr/local/uvst/standard/jdk1.6.0_18/jre/lib/rt.jar

I already have read a similar question here but I don't agree with the answers at Access restriction on class due to restriction on required library rt.jar?.

Because in a normal Java project no

Access restriction on class due to restriction

warning appears.

The classpath setup in my normal Java project contains all libraries with are shipped with the latest distribution of Axis 1.4 (I know it's rather old).

The dependency section of my pom.xml:

<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId&g开发者_StackOverflow中文版t;
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.4</version>
</dependency>

The class QName is located in axis-jaxrpc.jar!

Is there a possibility to make things going right, without killing class-files from libraries or disable warning settings within the IDE?


Does this happen under Eclipse only? If yes, you can modify the compiler settings as explained in the m2eclipse FAQ:

Compilation errors on restricted classes

Projects using classes from rt.jar, such as com.sun.* (and some others) can have compilation errors like: "Access restriction: The type RE is not accessible due to restriction on required library /lib/rt.jar". Such errors indicate use of non-API classes and those access rules are defined by Eclipse JDT.

You can change compiler settings to not fail on those restrictions in workspace settings in Window / Preferences / Java / Compiler / Errors/Warnings / Deprecated and restricted API / Forbidden reference (access rules) / Warnings; or per-project from Project / Properties / Java Compiler / Errors/Warnings / Deprecated and restricted API / Forbidden reference (access rules) / Warnings


The Maven2 plugin which is shipped with MyEclipse 8.5, configures the default built-path with JDK 1.4, I altered these to my actual JDK 1.6 installation a now it works as it should.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜