我正在尝试开发Axis2
网络服务。我创建了一个动态 Web 项目来从WSDL
. 一旦我实现了我的逻辑,Skelton
其中有代码可以查询数据库。
所有这些数据库访问逻辑都在另一个 Maven 构建的项目中。我将此 Maven 构建项目作为我的 webservice 项目中的依赖项添加BuildPath
到我的 webservice 项目中,该项目不是 maven 构建的。
当我运行此 Web 服务并从中访问该服务时Soap UI
,我得到No ClassDef Found Error
如下信息。
[ERROR] com/sample/test/common/dao/PersonDAO
java.lang.NoClassDefFoundError: com/sample/test/common/dao/PersonDAO
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.axis2.util.Utils$8.run(Utils.java:768)
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
at org.apache.axis2.util.Utils.createServiceObject(Utils.java:765)
at org.apache.axis2.receivers.AbstractMessageReceiver.makeNewServiceObject(AbstractMessageReceiver.java:245)
at org.apache.axis2.receivers.AbstractMessageReceiver.getTheImplementationObject(AbstractMessageReceiver.java:282)
at rg.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
我的网络服务代码
public class EnrollmentServiceSkeleton implements EnrollmentServiceSkeletonInterface{
@Autowired
PersonDAO personDao; // Getters and Setters.
public EnrollmentServiceRespMessage enrollmentServiceProfile (EnrollmentServiceReqMessage enrollmentService) {
// My WebService Logic
}
将maven项目作为对另一个非maven的依赖项直接在非maven项目的构建路径中是正确的方法吗?