English 中文(简体)
com.sun.xml.internal.ws.client 并不存在
原标题:com.sun.xml.internal.ws.client does not exist
  • 时间:2012-05-16 08:38:26
  •  标签:
  • java

我试图赶上客户的汇款,我的方案在汇编阶段失败,但有以下例外:

[ERROR]workspace
atesjavaserviceundle1srcmainjavacomconnectorwsTestClass1.java:[72,70] package com.sun.xml.internal.ws.client does not exist

我知道,这一揽子措施是从侵权行为中产生的,存在于 j里。

如果我加上“支持战争”(“限制”),它从Eclipse Maven Plugin汇编成册,但不从英特尔利J(通过maven)或指挥线收集。

当我去除@Suppresswarnings Eclipse时,我会发出以下警告:

Access restriction: The type ClientTransportException is not accessible due to restriction on required library C:Program FilesJavajre6lib
t.jar

I ve found similar question 但是,我的答案就足够了,因为我可以把这一类推到侵权行为。

谁能解释这种行为和可能的解决办法?

问题回答

http://www.oracle.com/technetwork/java/faq-sun- Packages-142232.html 直接打电话给太阳能包裹的做法是错误的。 当我遇到同样的问题时,它被排在<条码>上。

您可通过以下方式消除这一错误:

javac -XDignore.symbol.file=true

这 s倒了使用侵权行为的争论(ct.sym)。 系按违约情况使用,需要编纂成目标旧版本。

ct.symdoes not includes all categories from rt.jar. 由于使用<代码>sun.* 这些班级不得在<代码>ct.sym上使用,因为汇编工作失败。

将电话移至sun.*应当删除这一问题。 (使用太阳能包裹的做法是错误的)

References :

https://blogs.oracle.com/geertjan/ctsym-steals-the-asm-class”rel=“noreferer”>https://blogs.oracle.com/geertjan/ctsym-steals-the-asm-class

事情的真相是,在JDK有所谓的“历史”。 当javac正在编纂法典时,它就没有与侵权行为的联系。 相反,它使用特殊标志文件校准/字眼,并带有分类标签。 内部的JDK课程没有列入这一文号,因为这些课程是内部课程。 你们根本不想使用这些工具。

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6778491

This is not a compiler issue. javac is behaving correctly, according to the information provided in ct.sym. The issue belongs with those who decide what should be available with (and what should be hidden by) ct.sym I cannot as yet determine the correct category for this bug. This is intentional. Perhaps the package name "com.sun.xml.internal...." might be seen as a hint. Users should not write code that depends on internal JDK implementation classes. Such classes are internal implementation details of the JDK and subject to change without notice.

http://openjdk.java.net/jeps/247

For JDK N and --release M, M < N, signature data of the documented APIs of release M of the platform is needed. This data is stored in the $JDK_ROOT/lib/ct.sym file, which is similar, but not the same, as the file of the same name in JDK 8. The ct.sym file is a ZIP file containing stripped-down class files corresponding to class files from the target platform versions. For JDK N and --release N,the JDK s own image is used as the source of the class files to compile against. The list of observable modules is limited, however, to the documented modules and the jdk.unsupported module.


<><>>>>>>>><>>>>>>>>

In this case, it would be better to not use the ClientTransportException class and replaced it by javax.xml.ws.WebServiceException, as suggested by artbristol.

Jre System 图书馆限制一些包裹接触编辑,而JDK则可以查阅。 在这种情况下,在编码上不会有错误,但在编纂时,就会发现诸如没有发现的类别或没有发现的包裹之类的错误。

In that case there are two practices. 1) Add rt.jar of jre system library to your build path for compiling and building. 2) Add jaxws-rt.jar in your build path.

Second option is a good option as it will avoid adding duplicate libraries to your build path.

在pom.xml进口这种依赖

   <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.1.4</version>
   </dependency>

解决办法非常简单:如果你复制现成的法典,或首先写法,然后装上受抚养人,则存在依赖性冲突。 com.sun.xml.* Pack has been part of JDK8, but Maven在汇编时看不到。 因此,确保你使用包装材料:mvn:repo:/...rt.jar not jdk* / ....../rt.jar.

即便在2015年,我也发现了许多利用这一坏做法进口<编码>com.sun.*包的项目。

如果你(与我一样)能够改变进口这些包裹的班级,那么,在你的班次中添加<代码>rt.jar。

注:上述<代码>rt.jar通常见<jdk_home>/jre/lib

Even I was facing same issue in my maven project. I had imported import com.sun.xml.internal.ws.client.ResponseContext; in one of class file but this was not in use. I just commented the line in my class file and the error stopped and i could successful run my maven project.

玉米加起来,将解决这一问题。

基本上增加汇编者的论点,以提及正确的工具途径。 jar

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <compilerArguments>
                <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar${path.separator}${java.home}/../lib/tools.jar</bootclasspath>
            </compilerArguments>
        </configuration>
    </plugin>

You should not use com.sun.* packages. We could solve the problem by using our own class instead:

/**
 * Copy of com.sun.xml.internal.ws.client.BindingProviderProperties since we re
 * not allowed to use com.sun.* packages..     
 */
public final class BindingProviderProperties {
    public static final java.lang.String CONNECT_TIMEOUT = "com.sun.xml.internal.ws.connect.timeout";
    public static final java.lang.String REQUEST_TIMEOUT = "com.sun.xml.internal.ws.request.timeout";
}




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签