gpt4 book ai didi

java - 同名的类/接口(interface)已存在: SQLException and sqlException

转载 作者:太空宇宙 更新时间:2023-11-04 13:08:02 27 4
gpt4 key购买 nike

我有一个 Web 服务代码,它连接到在 MySQL 上运行的数据库。我清理并构建了它,部署成功,但是当我测试时出现以下错误:

Invoking wsimport with http://localhost:8080/getExamInfo/getInfo?WSDL
Info: parsing WSDL...
Info: [ERROR] A class/interface with the same name "com.getexaminfo.SQLException" is already in use. Use a class customization to resolve this conflict.
Info: line 22 of http://localhost:8080/getExamInfo/getInfo?xsd=1
Info: [ERROR] (Relevant to above error) another "SqlException" is generated from here.
Info: line 31 of http://localhost:8080/getExamInfo/getInfo?xsd=1
Info: [ERROR] This error is caused because on Windows you cannot have both "SqlException.java" and "SQLException.java" in the same directory.

根据我的理解,问题在于 NetBeans 试图在一个文件夹中创建多个具有不同大小写敏感性的 sqlexception.java。我尝试了一些解决方案,但似乎没有任何效果。我该如何解决这个问题?如果需要,我可以向您展示代码。

编辑:这是我到目前为止所取得的进展。我为从服务生成的架构创建了一个新的 XML 绑定(bind),这次它没有显示任何错误,但无法正确部署。我从 glassfish 得到了这个堆栈跟踪:

Warning:   AS-DEPLOYMENT-00012
java.lang.ClassNotFoundException: com.getExamInfo.getInfo
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1783)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
at com.sun.enterprise.deployment.annotation.impl.ModuleScanner.getElements(ModuleScanner.java:297)
at com.sun.enterprise.deployment.archivist.Archivist.processAnnotations(Archivist.java:586)
at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:463)
...

最佳答案

is trying to create multiple sqlexception.java in one folder with different case sensitivities

根据错误消息,您使用的是Windows,并且在Windows操作系统中不可能在同一目录中创建两个区分大小写不同的文件

How can i resolve this?

问题可能会得到解决:

  1. 更改 SqlException.java 类之一,
  2. 如果您使用 Windows 以外的其他操作系统,

如果您无法做到这一点,请向我们提供 wsdl 文件和您的代码。

关于java - 同名的类/接口(interface)已存在: SQLException and sqlException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34243372/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com