ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

使用Java 9运行应用程序,模块java.base不会“打开java.io”

2019-10-26 06:00:16  阅读:281  来源: 互联网

标签:wildfly ejb java-9 java


我试图用Java 9运行我的应用程序(使用Java Swing开发的前端,使用部署在Wildfly 8上的EJB开发的服务器).
当客户端尝试建立EJB连接时,出现以下异常:

    09:53:42,358 INFO  [xnio] XNIO version 3.2.0.Final
09:53:42,465 INFO  [nio] XNIO NIO Implementation Version 3.2.0.Final
09:53:42,507 DEBUG [nio] Started channel thread 'Remoting "config-based-naming-client-endpoint" I/O-1', selector sun.nio.ch.WindowsSelectorImpl@4b4a5caf
RmiServiceFactpry ExceptionInInitializerError
java.lang.ExceptionInInitializerError
    at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:148)
    at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:106)
    at org.jboss.ejb.client.EJBClientContext.registerConnection(EJBClientContext.java:465)
    at org.jboss.naming.remote.client.ejb.RemoteNamingStoreEJBClientHandler.associate(RemoteNamingStoreEJBClientHandler.java:78)
    at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.<init>(RemoteNamingStoreV1.java:71)
    at org.jboss.naming.remote.protocol.v1.VersionOne.getRemoteNamingStore(VersionOne.java:50)
    at org.jboss.naming.remote.protocol.Versions.getRemoteNamingStore(Versions.java:55)
    at org.jboss.naming.remote.client.RemoteContextFactory.createVersionedStore(RemoteContextFactory.java:73)
    at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:202)
    at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:149)
    at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:130)
    at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:272)
    at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)
    at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)
    at java.naming/javax.naming.InitialContext.lookup(Unknown Source)
    at com.dataloy.client.core.RmiServiceFactory.createRemote(RmiServiceFactory.java:105)
    at com.dataloy.client.core.RmiServiceFactory.getServiceImpl(RmiServiceFactory.java:96)
    at com.dataloy.core.AbstractServiceFactory.getService(AbstractServiceFactory.java:58)
    at com.dataloy.DataloyEngine.getService(DataloyEngine.java:198)
    at com.dataloy.DataloyEngine.login(DataloyEngine.java:548)
    at com.dataloy.client.login.LoginPanel.doLogin(LoginPanel.java:511)
    at com.dataloy.client.login.LoginPanel.access$500(LoginPanel.java:56)
    at com.dataloy.client.login.LoginPanel$5.run(LoginPanel.java:452)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make java.io.OptionalDataException(boolean) accessible: module java.base does not "opens java.io" to unnamed module @312002a1
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
    at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Unknown Source)
    at java.base/java.lang.reflect.Constructor.setAccessible(Unknown Source)
    at org.jboss.marshalling.Marshalling$OptionalDataExceptionCreateAction$1.run(Marshalling.java:385)
    at org.jboss.marshalling.Marshalling$OptionalDataExceptionCreateAction$1.run(Marshalling.java:381)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.marshalling.Marshalling$OptionalDataExceptionCreateAction.<init>(Marshalling.java:381)
    at org.jboss.marshalling.Marshalling$OptionalDataExceptionCreateAction.<init>(Marshalling.java:376)
    at org.jboss.marshalling.Marshalling.<clinit>(Marshalling.java:374)
    ... 23 more

我看到Java 9中引入的新模块管理存在一些问题,但是我不知道应该怎么做.

问候,
安德里亚

解决方法:

this answer开始,您需要在启动应用程序的java命令中添加–add-opens java.base / java.io = ALL-UNNAMED.

标签:wildfly,ejb,java-9,java
来源: https://codeday.me/bug/20191026/1934495.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有