我关注this tutorial。然后我按照步骤进行操作。但是我收到了这个错误:
org.eclipse.core.runtime.CoreException: Module named '_auto_generated_ear_' failed to deploy. See Error Log view for more detail.
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deployAutoGenerateEarApplication(WlsJ2EEDeploymentHelper.java:806)......
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1425)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:917)
Contains: Module named '_auto_generated_ear_' failed to start.
Contains: weblogic.application.ModuleException: [HTTP:101216]Servlet: "Jersey REST Service" failed to preload on startup in Web application: "com.restful.oracle.weblogic.youtube".
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
:com.sun.jersey.api.container.ContainerException:The ResourceConfig instance does not contain any root resource classes.
java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:189)
at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.startModule(WlsJ2EEDeploymentHelper.java:1127)
Caused by: weblogic.application.ModuleException: [HTTP:101216]Servlet: "Jersey REST Service" failed to preload on startup in Web application: "com.restful.oracle.weblogic.youtube".
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1298)
我的web.xml是
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>com.restful.oracle.weblogic.youtube</display-name>
<welcome-file-list>
<welcome-file>readme.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.restful.oracle.weblogic.youtube</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>*</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
我有jersey 1.9.1加入这个项目。我是休息或weblogic的新人 我也查看了Stackoverflow但没有帮助 你能帮我解决这个问题吗?如果您需要任何信息,请发表评论。 感谢
答案 0 :(得分:0)
添加新的servlet并删除后,我遇到了同样的问题。 删除后,web.xml没有更新,我需要删除那些删除的servlet的引用。 删除它,例如:
forfiles /C "forfiles forfiles /M *"
答案 1 :(得分:0)
我认为问题的原因是部署的war文件未正确创建。我强烈建议您通过右键单击 - &gt; export-&gt; war导出war文件,并使用7zip / winrar等检查war文件内容。