问题标签 [payara]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
592 浏览

jsp - GlassFish 错误“我不理解此 jvm 选项的格式:”

我的 GlassFish(Payara) 服务器的本地实例有问题。当我通过 IntelliJ(重新)部署 JSP-Projekt 时,即使重新部署成功,我也会收到以下警告:

为了解决这个警告,我结束了一个正在监听这个端口的正在运行的 java-instance。自从我尝试重新部署我的 JSP 项目以来,我收到了错误消息

I don't understand the format of this jvm-option: "-javaagent:C:\Program

每次。服务器没有运行,因此我无法连接它。也无法通过控制台或批处理文件手动启动 GlassFish 服务器。

jvm的给定文件路径似乎有问题。有谁知道它是如何存储的以及如何手动更改它?

0 投票
1 回答
921 浏览

glassfish-4.1 - Glassfish/Payara:为什么将大型 Web 应用程序部署到 Glassfish-4.1.1(或 Payara Server 4.1.1.163)所需的时间是 Glassfish-4.1 的 5 倍

直到最近我一直在使用:

我最近使用以下方法进行了调查:

对于一个非常大的 JSF Web 应用程序(使用 ObjectDB 作为 JPA 持久性提供程序),我体验到 Glassfish4.1.1 的部署时间(超过 10 分钟)比 Glassfish4.1 的部署时间(大约 2 分钟)要长得多。这大约慢了 5 倍。

[编辑:2016-09-13 尝试使用 Payara 163 Full (Payara Server 4.1.1.163),它花了 20 多分钟,甚至比 Glassfish4.1.1 慢,设置几乎相同]

我不可能在这里重现或提供大型网络应用程序的示例。

Q1:有没有人经历过 Glassfish-4.1 和 Glassfish-4.1.1 [编辑:OR Payara Server 4.1.1.163]之间的任何类似差异,我可以在哪里寻找差异点?

(我已经在尝试使用 NetBeans Profiler 进行调查,但要找到原因并不是那么容易。)


[编辑:2016-09-15 计时测试]

我使用截屏录像进行了仔细的并排比较,并与日志中的时间进行了比较。

在 Payara41 (4.1.1.163) 和 Glassfish4.1.1 中,它被“卡住”了大约 10 分钟,如下所示,我还没有找到任何日志设置在出现问题的地方提供单行输出,并在其中运行服务器DEBUG 模式似乎也没有提供任何额外的信息。

...通过所有步骤运行正常,然后通过数十个 EJB JNDI 名称声明:

给出此 WELD 版本消息:

...然后在此消息之前大约需要 8 秒 ..

...然后在恢复这些原本无害的警告之前需要几分钟(通常大约 10 分钟) ..

]]

Glassfish4.1 日志中会出现类似的警告消息,但不会出现长时间的暂停/阻塞。

Q2:我还能做些什么来找出为什么它会在那里暂停/停滞很久?

0 投票
1 回答
615 浏览

ejb-3.1 - Java EE 7 EJB 3.2 Payara 4.1.1.154

我将一个项目从 Java EE 6 迁移到 Java EE 7。作为依赖项,我有 javaee 7.0,payara-embedded-all4.1.1.154
我将 beans.xml 迁移到:

还将 web.xml 用于:

并用 glassfish-web.xml 替换 sun-web.xml:

一切都是可编译的,但是当我想将应用程序部署到 payara 时遇到问题:

同样奇怪的是它给了我EJB31_Generated并且我添加了一个 maven-ejb-plugin 版本 3.2 和 Payara 4.1.1.154。

有人知道为什么吗?

0 投票
2 回答
176 浏览

payara - 如何使用 API 向 Payara Micro 发出请求?

我正在尝试完成一个部署战争并发出一些 REST 请求的测试用例。

我想使用 Payara Micro JAVA API,并且在设置 boostrap 方面有了一个良好的开端

...并部署我的战争

我的战争部署正确。

我从这里去哪里?我应该将我的请求指向哪里?

0 投票
0 回答
252 浏览

java - Vaadin 应用程序错误:根据请求中的数据未找到 UI

我所在的团队正在使用 Netbeans IDE 8.1 和 Payara GlassFish Server(版本 4.1.1.161.1)和最新的 Chrome 浏览器构建 Vaadin 应用程序。

当我在清理和构建所有项目后运行应用程序时会出现问题。启动 UI 上的所有事件侦听器都没有响应,关闭选项卡后,服务器控制台日志中会显示:

Info: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.

有趣的是,团队的另一位成员具有相同的基本代码,并且在他的机器上运行良好(与我的规格相同)。任何人对我们的机器之间可能有什么不同或为什么会发生这个错误有任何想法?

更新:一旦我摆脱启用推送的注释,按钮就会变得响应。关于为什么@Push会导致听众变得反应迟钝的任何想法?

0 投票
1 回答
1196 浏览

java - payara上的NoClassDefFoundError

最近我将我的开发从 Glassfish 4.1 迁移到 Payara-4.1.1.161.1。

今天我重新打开了几个月没有碰过的项目。当我尝试编译和运行项目时,我在控制台日志中看到以下内容

我花了很多时间试图找出发生了什么,将项目恢复到第一阶段,但我仍然无法启动它。

在绝望的举动中,我决定尝试在旧的 Glassfish 4.1 上发布这个项目(它仍然在我的硬盘上)。它开始时没有任何问题。

我不知道问题的根源是什么。它在某种程度上与 ide 生成的部分有关

我尝试切换 JDK。JDK 1.8.77 和 1.8.91 的行为方式相同。我也尝试了 pre relase payara build,同样的。

您能否给我一些建议以使这项工作与 Payara 一起工作,如何跟踪错误。

编辑 1

我相信这种行为在某种程度上与我的应用程序使用持久性模块中定义的 2 个连接这一事实有关。

如果我禁用线路

然后应用程序启动(但我的登录控制器没有工作,应用程序在登录尝试时出现异常)。

所以我再次启用了该行,但在登录控制器中,我用@Named 替换了@ManagedBean 并稍微调整了控制器。在此之后,我再也看不到错误了。我不确定为什么这会有所帮助。

编辑 2

@Mike 揭示了问题的根源。这是由于 EclipseLink 版本太旧造成的。我使用的是 2.5.2,正确的是 2.6.x

0 投票
2 回答
430 浏览

jakarta-ee - 使用 Payara 4.1.1 在不同的 JAR 中加载 CDI bean

我们目前正在将我们的 JEE 6 应用程序(WAR 部署)从 GF 3.1 移植到 Payara 4.1.1。我们正在使用 EJB 和 CDI bean。它们被打包在不同的 jar 文件中。我面临无法找到位于另一个 jar 文件中的 CDI bean 的问题。每个 jar 文件都有自己的 META-INF/beans.xml,还有一个用于 WAR (WEB-INF/beans.xml) 存档。我已经尝试了以下步骤:

  • 采用 beans.xml (bean-discovery-mode="all")
  • 在 EAR 部署中部署 WAR。
  • 随 CDI 1.1 更改的注释已更改
  • 将所有库更新到最新版本(richfaces、guava、eclipselink...)以满足 JEE 7 要求

有人知道 Glassfish/Payara 4.1.1 中是否存在一般错误?

谢谢,伯恩德

不幸的是,这并没有帮助。我做了一些更多的调查,似乎只有“一些”bean 不能正确地从 BeanManager 注入或检索。这里的类层次结构不起作用:

}

如果我将上面的课程更改为:

注射有效。

如果我尝试通过 BeanManager 注入 bean,如果我执行基于类型的搜索,getBeans() 方法将不起作用:

如果我在“类”参数中提供接口类,则返回值始终为空。

0 投票
3 回答
2243 浏览

payara - 配置文件

我需要从配置文件中读取一些属性。我不想将属性文件存储在该位置内。什么是最佳实践

例如,如果执行如下

我想保留 payara-micro.jar 所在的参数文件。我需要读取war文件中的属性文件。如何实现它。

谢谢你。

0 投票
2 回答
618 浏览

jpa - 从 GF 3.1.2 迁移到 Payara 4.1.1 后的 Eclipselink 异常

我正在将项目从 GF 3.1.2 (Eclipselink 2.3.2) 迁移到 Payara 4.1.1.162 (Eclipselink 2.6.2)。

在部署我的战争档案期间,我收到以下异常:

Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2035) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2026) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:347) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:313) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:207) at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:114) at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223) at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510) at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:926) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:435) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:220) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:487) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:263) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:234) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:285) at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:316) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231) ... 75 more Caused by: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.ecli]]

[2016-05-10T15:58:35.406+0200] [Payara 4.1] [SEVERE] [] [] [tid: _ThreadID=43 _ThreadName=admin-listener(1)] [timeMillis: 1462888715406] [levelValue: 1000] [[ pse.persistence.internal.jpa.metamodel.MetamodelImpl.preInitialize(MetamodelImpl.java:398) at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.(MetamodelImpl.java:113) at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.(MetamodelImpl.java:132) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.preInitializeMetamodel(EntityManagerSetupImpl.java:3772) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2012) ... 73 more]]

[2016-05-10T15:58:35.408+0200] [Payara 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=43 _ThreadName=admin-listener(1)] [timeMillis: 1462888715408] [levelValue: 1000] [[ Exception while preparing the app]]

[2016-05-10T15:58:35.408+0200] [Payara 4.1] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=43 _ThreadName=admin-listener(1)] [timeMillis: 1462888715408] [levelValue: 1000] [[ Exception during lifecycle processing javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2035) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2026) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:347) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:313) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:207) at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:114) at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223) at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510) at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:926) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:435) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:220) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:487) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:263) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:234) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:285) at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:316) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231) ... 75 more Caused by: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.preInitialize(MetamodelImpl.java:398) at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.(MetamodelImpl.java:113) at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.(MetamodelImpl.java:132) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.preInitializeMetamodel(EntityManagerSetupImpl.java:3772) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2012) ... 73 more ]]

[2016-05-10T15:58:35.421+0200] [Payara 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=43 _ThreadName=admin-listener(1)] [timeMillis: 1462888715421] [levelValue: 1000] [[ Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl Local Exception Stack: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2035) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2026) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:347) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:313) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:207) at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:114) at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223) at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510) at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:926) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:435) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:220) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:487) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565) at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:263) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:234) at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:285) at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:316) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.preInitialize(MetamodelImpl.java:398) at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.(MetamodelImpl.java:113) at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.(MetamodelImpl.java:132) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.preInitializeMetamodel(EntityManagerSetupImpl.java:3772) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2012) ... 73 more ]]

[2016-05-10T15:58:35.593+0200] [Payara 4.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=46 _ThreadName=admin-listener(4)] [timeMillis: 1462888715593] [levelValue: 800] [[ Exception Occurred :Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [objsetupDB] failed. Internal Exception: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.metamodel.EntityTypeImpl cannot be cast to org.eclipse.persistence.internal.jpa.metamodel.MappedSuperclassTypeImpl. Please see server.log for more details. ]]

在项目中,我们使用 MappedSuperclasses 的层次结构,例如:

层次结构如下:

我已经将 Payara 的登录设置为 FINEST,但不幸的是我没有得到任何进一步的信息。我还尝试在 WEB-INF/lib 文件夹中部署 Eclipselink jar,但这并没有改变行为。有没有人知道为什么会有 ClasscastException?

谢谢你的帮助,伯恩德

0 投票
1 回答
537 浏览

primefaces - primefaces graphicsimage CDI bean不起作用

我在显示我的数据库检索到的图像时遇到了一些问题。

查看来电者:

控制器:

这段代码什么也没显示,看起来该方法从未被调用(从不在控制台中打印)!

经过几天的尝试更改范围后,我尝试使用@ManagedBean 而不是@Named,它有效!!!

有人可以解释一下为什么这仅适用于@ManagedBean 而不适用于@Named?