JAX-RS Rest 服务停止在 Eclipse Glassfish 上部署

2024-01-14

我使用 Eclipse 在 Glassfish 4.1.1 上开发 Jersey JAX-RS 应用程序大约一年了。今天早些时候,我对某些类进行了一些正常的更改,但是当我尝试进行构建时,Eclipse 没有更新这些类。我在 Stack Overflow 上搜索,发现这个答案 https://stackoverflow.com/questions/9573416/why-isnt-eclipse-updating-the-classes.

所以我做了以下步骤:

  1. 项目 > 清洁关于您正在从事的项目。
  2. 项目 > 构建自动 - 打开,以便代码在保存的更改后在您的工作区中重建。
  3. 窗口 > 首选项并确保您安装的 JRE 和编译器与 Java 版本匹配

我安装的jre是jdk1.8.0_73我的编译器合规级别是 1.8

现在,当我对 Java 文件进行更改时,下面的服务器选项卡仍然不会显示

[已开始,重新发布]

喜欢它应该但停留在

[已开始,已同步]。

情况变得更糟。现在,当我尝试使用 POSTMAN 和我使用过一百万次的查询来访问其余服务时,它会返回 404,表示请求的资源不可用。

因此基本上没有一个 REST 服务由于某种原因无法正常启动。

如果我为应用程序点击 index.html,它会正常运行,但是当 AngularJS 尝试从 REST 后端加载内容时,它会收到 404 错误。

我没有对 Eclipse/Glassfish 进行任何更改,因为它昨天工作得很好。这完全停止了发展。有人知道可能出了什么问题吗?这真是令人心烦意乱。

我不是 Eclipse、Glassfish 或 jersey 方面的专家,所以请对我宽容一点:)

这是我启动服务器时的构建日志,也许有人可以注意到发生了什么......

2016-10-02T15:24:47.575+0100|Info: Running GlassFish Version: GlassFish Server Open Source Edition  4.1.1  (build 1)
2016-10-02T15:24:47.576+0100|Info: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
2016-10-02T15:24:47.664+0100|Info: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2016-10-02T15:24:47.665+0100|Info: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2016-10-02T15:24:47.670+0100|Info: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
2016-10-02T15:24:47.775+0100|Info: Authorization Service has successfully initialized.
2016-10-02T15:24:47.825+0100|Info: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
2016-10-02T15:24:47.948+0100|Info: JTS5014: Recoverable JTS instance, serverId = [100]
2016-10-02T15:24:47.965+0100|Warning: Instance could not be initialized. Class=interface org.glassfish.grizzly.http.server.AddOn, name=http-listener-1, realClassName=org.glassfish.grizzly.http2.Http2AddOn
2016-10-02T15:24:48.037+0100|Info: Grizzly Framework 2.3.23 started in: 54ms - bound to [/0.0.0.0:8080]
2016-10-02T15:24:48.051+0100|Warning: Instance could not be initialized. Class=interface org.glassfish.grizzly.http.server.AddOn, name=http-listener-2, realClassName=org.glassfish.grizzly.http2.Http2AddOn
2016-10-02T15:24:48.055+0100|Info: Grizzly Framework 2.3.23 started in: 1ms - bound to [/0.0.0.0:8181]
2016-10-02T15:24:48.057+0100|Warning: Instance could not be initialized. Class=interface org.glassfish.grizzly.http.server.AddOn, name=admin-listener, realClassName=org.glassfish.grizzly.http2.Http2AddOn
2016-10-02T15:24:48.062+0100|Info: Grizzly Framework 2.3.23 started in: 2ms - bound to [/0.0.0.0:4848]
2016-10-02T15:24:48.093+0100|Info: Grizzly Framework 2.3.23 started in: 1ms - bound to [/0.0.0.0:3700]
2016-10-02T15:24:48.316+0100|Info: visiting unvisited references
2016-10-02T15:24:48.655+0100|Info: Java security manager is disabled.
2016-10-02T15:24:48.656+0100|Info: Entering Security Startup Service.
2016-10-02T15:24:48.658+0100|Info: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
2016-10-02T15:24:48.677+0100|Info: Security Service(s) started successfully.
2016-10-02T15:24:48.829+0100|Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
2016-10-02T15:24:48.833+0100|Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
2016-10-02T15:24:48.835+0100|Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
2016-10-02T15:24:48.849+0100|Info: Created virtual server server
2016-10-02T15:24:48.851+0100|Info: Created virtual server __asadmin
2016-10-02T15:24:48.995+0100|Info: Setting JAAS app name glassfish-web
2016-10-02T15:24:48.996+0100|Info: Virtual server server loaded default web module 
2016-10-02T15:24:49.419+0100|Info: visiting unvisited references
2016-10-02T15:24:49.447+0100|Info: visiting unvisited references
2016-10-02T15:24:49.448+0100|Info: visiting unvisited references
2016-10-02T15:24:49.449+0100|Info: visiting unvisited references
2016-10-02T15:24:49.450+0100|Info: visiting unvisited references
2016-10-02T15:24:49.451+0100|Info: visiting unvisited references
2016-10-02T15:24:49.451+0100|Info: visiting unvisited references
2016-10-02T15:24:49.452+0100|Info: visiting unvisited references
2016-10-02T15:24:49.453+0100|Info: visiting unvisited references
2016-10-02T15:24:49.453+0100|Info: visiting unvisited references
2016-10-02T15:24:49.454+0100|Info: visiting unvisited references
2016-10-02T15:24:49.471+0100|Info: visiting unvisited references
2016-10-02T15:24:49.472+0100|Info: visiting unvisited references
2016-10-02T15:24:49.473+0100|Info: visiting unvisited references
2016-10-02T15:24:49.474+0100|Info: visiting unvisited references
2016-10-02T15:24:49.475+0100|Info: visiting unvisited references
2016-10-02T15:24:49.476+0100|Info: visiting unvisited references
2016-10-02T15:24:49.477+0100|Info: visiting unvisited references
2016-10-02T15:24:49.478+0100|Info: visiting unvisited references
2016-10-02T15:24:49.479+0100|Info: visiting unvisited references
2016-10-02T15:24:49.571+0100|Info: WELD-000900: 2.2.13 (Final)
2016-10-02T15:24:50.041+0100|Info: HV000001: Hibernate Validator 5.1.2.Final
2016-10-02T15:24:50.250+0100|WARN: WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
2016-10-02T15:24:50.250+0100|WARN: WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
2016-10-02T15:24:50.407+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.413+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.415+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.427+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.428+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.429+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.430+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.433+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.436+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.437+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.438+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.439+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.440+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.441+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.442+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.444+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.444+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.445+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.445+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.447+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.448+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.448+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] org.glassfish.sse.impl.ServerSentEventCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.450+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:50.451+0100|WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jms.injection.JMSCDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2016-10-02T15:24:51.764+0100|Info: Loading application [pododdle] at [/pododdle]
2016-10-02T15:24:51.766+0100|Info: Loading application pododdle done in 3,949 ms
2016-10-02T15:24:51.766+0100|Info: GlassFish Server Open Source Edition  4.1.1  (1) startup time : Felix (1,264ms), startup services(4,275ms), total(5,539ms)
2016-10-02T15:24:51.821+0100|Info: Grizzly Framework 2.3.23 started in: 2ms - bound to [/0.0.0.0:7676]
2016-10-02T15:24:52.061+0100|Info: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@7bbbb6a8 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@b18c4.
2016-10-02T15:24:52.082+0100|Info: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://PododdlePC:8686/jndi/rmi://PododdlePC:8686/jmxrmi

看起来这个错误是由于项目构建不正确引起的。检查构建路径后,似乎有两个 jar 文件神秘丢失!他们是:

jersey-media-multipart-2.21.1.jar
mimepull-1.9.3.jar

我不知道这些 jar 文件是如何从 glassfish 服务器的 /lib 目录中删除的,也许我不应该多喝那瓶威士忌。一旦它们被重新添加进来,一切都突然变得很顺利。对这个错误有点困惑 - 我本以为如果 jar 不可用,它会给出编译错误。不管怎样,由于另一个恼人的错误,损失了 5 天。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

JAX-RS Rest 服务停止在 Eclipse Glassfish 上部署 的相关文章

  • Android ClassNotFoundException:在路径上找不到类

    10 22 15 29 40 897 E AndroidRuntime 2561 FATAL EXCEPTION main 10 22 15 29 40 897 E AndroidRuntime 2561 java lang Runtime
  • Eclipse 中的搜索框

    When I hit Ctrl F in Eclipse it would bring up a search box asking for the term etc That s annoying because if I m on a
  • 实体创建无用的 id 字段

    我有一个CrudRepository与两个实体 Problem 特征实体总是创建一个附加的id数据库中的字段但未选择正确的characteristic id要生成的字段JSON machine entity machine id name
  • Eclipse 在单独的窗口中打开代码

    我正在 eclipse 中编程 在两个显示器设置上运行 在其中一台显示器上 我只获得了项目资源管理器和编辑器作为自定义透视图 而在另一台显示器上 我获得了其他工具 例如控制台 调试 任务 变量 断点等 例如 当我单击任务视图中的任务时 这将
  • 如何在Eclipse中制作war文件[重复]

    这个问题在这里已经有答案了 制作war文件的简单方法是什么 当我右键单击 在服务器上运行 时 我的项目正在运行 但我想部署在 tomcat 服务器上 我已经安装了m2clipse但这给了我一个错误 maven是否必须制作war文件 我需要特
  • 如何在 Jersey RESTful Web 服务中放置 cookie?

    我想通过 Jersey API 将 cookie 从 PUT webservice result 放置到 POST webservice 这是我的代码 WebResource service1 client resource http te
  • Eclipse PTP:在本地计算机上运行并行(MPI)应用程序?

    必须如何配置 eclipse PTP 才能在本地计算机上使用 OpenMPI 运行 MPI 应用程序 使用 添加资源管理器 我可以选择 OpenMPI 并在 连接名称 中切换到本地主机 但仍然要求我提供一些用户名和密码 这是正确的方法吗 D
  • java.lang.Object#getClass() 的 Eclipse 外部空注释

    我正在使用 Eclipse Mars 中提供的外部空注释工具 我正在尝试添加外部注释java lang Object getClass 但似乎无法正确签名 我尝试过以下变体 NonNull Class getClass L1java lan
  • 不断收到错误消息,表示 localhost 的 Server App Engine Standard 无法启动

    当尝试在 Eclipse 中启动 Google 应用程序引擎项目时 我不断收到错误消息 指出本地主机上的服务器应用程序引擎标准无法启动 错误日志如下 以前有人遇到过这个问题吗 问题的原因是什么 WARNING An illegal refl
  • Eclipse git checkout(又名恢复)

    是否可以做相当于git checkout在 Eclipse 中使用 Egit 插件 我有一个已修改的文件 我想放弃更改并将文件恢复到源存储库中的内容 在 Subversion 中 这称为恢复 在 git 中 相当于 checkout 我在团
  • 场景生成器删除 fxml 文件中的导入

    我使用场景构建器 Gluon Scene Builder JavaFX Scene Builder 8 1 1 来创建应用程序的 UI 并使用 Eclipse 开发 JavaFX 现在 每次我在场景生成器中保存某些内容时 它都会从 fxml
  • 配置 Eclipse/EGit 来跟踪上游存储库

    我正在使用 EGit 如新的 Eclipse 4 2 Juno 版本中提供的 我在 GitHub 上有一个存储库 是从另一个上游存储库分叉的 当我从 Github 上的存储库在 Eclipse 中创建项目时 它正确设置origin指向 Gi
  • Spring:使用 ResponseEntity 返回空 HTTP 响应不起作用

    我们正在使用 Spring 4 1 1 实现 REST API 对于某些 HTTP 请求 我们希望返回一个没有正文的头部作为响应 然而 使用ResponseEntity
  • 如何在Windows上安装Xlib(eclipse、c语言)

    好的 我需要使用它进行图形编程 GUI cs 349 uwaterloo 第一次作业 我在谷歌搜索结果中看到随机的 Xlib h 和 Xutil h 文件 但它没有在哪里说明我如何从某个网站安装或下载 Xlib 我什至尝试将 Xlib h
  • 如何以编程方式下载公共 Google Drive 文件?

    我有一个后端服务器 必须下载 Google 云端硬盘上的文件 该文件已由所有者向公众共享 我们的客户通过电子邮件向我们发送链接 我们从电子邮件中获取链接 不涉及 UI 该程序需要获取或下载文件并离线处理它 谷歌示例似乎是使用 UI 运行的
  • PUT/DELETE 与 REST 是自动幂等的吗?

    我正在学习 REST 和 PUT DELETE 我读到这两者 以及 GET 都是幂等的 这意味着多个请求使服务器进入相同的状态 重复的 PUT DELETE 请求是否会离开 Web 浏览器 当使用XMLHttpRequest 换句话说 服务
  • 使用 Swagger UI 进行基本身份验证

    我正在尝试通过 Swagger UI 开发一个基于 spring boot 的 REST API 服务以及 API 文档 我想通过 swagger UI 启用基本身份验证 以便用户只有在使用 swagger UI 上的 授权 按钮进行身份验
  • 如何使用 PATCH 更新简单的数据库字段?

    我是 php 和 API 的新手 我正在尝试学习这些方法 但我无法执行 PATCH 或 PUT 来更新我的简单 mysql 数据库 我使用了以下代码 if isset PATCH con mysqli connect localhost r
  • Eclipse tomcat启动失败

    我在 Windows 7 x64 位 上运行 Eclipse Indigo 3 7 当我使用 Mongrel 一个用于运行 Tomcat 的 Eclipse 插件 启动 Tomcat 7 0 12 时 日食 我得到 May 24 2012
  • Laravel 5 Eloquent 在多个级别上将关系附加到 JSON

    因此 在模型中包含关系非常容易 例如 class User extends Model protected with roles class Role extends Model protected with permissions 当有对

随机推荐