简体   繁体   English

Glassfish无法找到进口的课程

[英]Glassfish cannot find imported class

I have a small webservice program in which I need to import JSONObject from external jar. 我有一个小的网络服务程序,需要从外部jar导入JSONObject。 While trying to deploy the webservice, the Glassfish couldn't find the imported class (from external jar), but things look fine in IDE. 尝试部署Web服务时,Glassfish找不到(从外部jar)导入的类,但是在IDE中看起来一切正常。

I tried to look into the log and found this : 我试图查看日志,发现了这一点:

[2017-11-17T16:22:49.429+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] [timeMillis: 1510932169429] [levelValue: 900] [[ StandardWrapperValve[MyApplication]: Servlet.service() for servlet MyApplication threw exception java.lang.ClassNotFoundException: org.json.simple.JSONObject [2017-11-17T16:22:49.429 + 0100] [glassfish 4.1] [警告] [] [javax.enterprise.web] [tid:_ThreadID = 30 _ThreadName = http-listener-1(1)] [timeMillis:1510932169429 ] [levelValue:900] [[StandardWrapperValve [MyApplication]:Servlet MyApplication的Servlet.service()引发了异常java.lang.ClassNotFoundException:org.json.simple.JSONObject

Can someone help me ? 有人能帮我吗 ?

You have to add the library to your Glassfish directory too. 您也必须将库添加到Glassfish目录中。 Otherwise Glassfish will not find it. 否则,玻璃鱼将找不到它。

Add the .jar file to <GLASSFISH_DIR>\\glassfish\\domain\\domain1\\lib and then restart your Glassfish. .jar文件添加到<GLASSFISH_DIR>\\glassfish\\domain\\domain1\\lib ,然后重新启动Glassfish。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tomcat找不到类“ InaccessibleWSDLException”,glassfish可以找到 - Tomcat cannot find class “InaccessibleWSDLException”, glassfish can 即使导入了类也找不到符号 - Cannot find symbol even with class imported Java 找不到导入的符号 scala class - Java cannot find symbol for imported scala class 部署到glassfish服务器时出现“ org.springframework.beans.factory.CannotLoadBeanClassException:找不到类…” - “org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class…” when deploying to glassfish server 导入的类无法解析为类型 - imported class cannot be resolved to a type 在Glassfish 3.0.1中找不到JPA CacheIndex注释 - Cannot find JPA CacheIndex Annotation in Glassfish 3.0.1 在NetBeans + Glassfish项目中找不到文件 - Cannot find file in netbeans + glassfish project 错误:找不到符号 - 在 IntelliJ IDEA 的现有 gradle 项目中添加和导入新 class 时 - error: cannot find symbol - when new class is added tand imported in an existing gradle project in IntelliJ IDEA 无法将类强制转换为同一类-在Glassfish服务器应用程序中重新启动后 - Class cannot be cast to the same class - after restart in Glassfish server application 找不到类MainActivity(导入的项目) - Can't find class MainActivity (imported project)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM