Java 从所需的 .class 文件间接引用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/115971/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Indirectly referenced from required .class file
提问by Ryan Thames
I'm getting an error message when I try to build my project in eclipse:
当我尝试在 Eclipse 中构建我的项目时收到一条错误消息:
The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced
from required .class files
The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced
from required .class files
I've looked online for a solution and cannot find one (except for those sites that make you pay for help). Anyone have any idea of a way to find out how to go about solving this problem? Any help is appreciated, thanks!
我在网上寻找解决方案,但找不到(除了那些让您付费寻求帮助的网站)。任何人都知道如何找到解决这个问题的方法吗?任何帮助表示赞赏,谢谢!
采纳答案by Kevin
How are you adding your Weblogic classes to the classpath in Eclipse? Are you using WTP, and a server runtime? If so, is your server runtime associated with your project?
您如何将 Weblogic 类添加到 Eclipse 中的类路径?您是否使用 WTP 和服务器运行时?如果是这样,您的服务器运行时是否与您的项目相关联?
If you right click on your project and choose build path->configure
build path and then choose the libraries tab. You should see the weblogic libraries associated here. If you do not you can click Add Library->Server Runtime
. If the library is not there, then you first need to configure it. Windows->Preferences->Server->Installed runtimes
如果您右键单击您的项目并选择构建path->configure
构建路径,然后选择库选项卡。您应该在此处看到关联的 weblogic 库。如果没有,您可以单击Add Library->Server Runtime
。如果库不存在,那么您首先需要对其进行配置。 Windows->Preferences->Server->Installed runtimes
回答by skiphoppy
Have you Googled for "weblogic ExpressionMap"? Do you know what it is and what it does?
您是否在 Google 上搜索过“weblogic ExpressionMap”?你知道它是什么以及它有什么作用吗?
Looks like you definitely need to be compiling alongside Weblogic and with Weblogic's jars included in your Eclipse classpath, if you're not already.
看起来您肯定需要与 Weblogic 一起编译,并且如果您还没有在 Eclipse 类路径中包含 Weblogic 的 jars。
If you're not already working with Weblogic, then you need to find out what in the world is referencing it. You might need to do some heavy-duty grepping on your jars, classfiles, and/or source files looking for which ones include the string "weblogic".
如果您还没有使用 Weblogic,那么您需要找出引用它的内容。您可能需要对 jars、类文件和/或源文件进行一些繁重的 grepping,以查找哪些包含字符串“weblogic”。
If I had to include something that was relying on this Weblogic class, but couldn't use Weblogic, I'd be tempted to try to reverse-engineer a compatible class. Create your own weblogic.utils.expressions.ExpressionMap class; see if everything compiles; use any resultant errors or warnings at compile-time or runtime to give you clues as to what methods and other members need to be in this class. Make stub methods that do nothing or return null if possible.
如果我不得不包含依赖于这个 Weblogic 类但不能使用 Weblogic 的东西,我会尝试对兼容的类进行逆向工程。创建自己的 weblogic.utils.expressions.ExpressionMap 类;看看是否一切都编译;在编译时或运行时使用任何由此产生的错误或警告来为您提供有关此类中需要哪些方法和其他成员的线索。如果可能,制作什么都不做或返回 null 的存根方法。
回答by Amin
Add spring-tx jar file and it should settle it.
添加 spring-tx jar 文件,它应该解决它。
回答by Akash
I was getting this error:
我收到此错误:
The type com.ibm.portal.state.exceptions.StateException cannot be resolved. It is indirectly referenced from required .class files
无法解析 com.ibm.portal.state.exceptions.StateException 类型。它是从所需的 .class 文件间接引用的
Doing the following fixed it for me:
执行以下操作为我修复了它:
Properties -> Java build path -> Libraries -> Server Library[wps.base.v61]unbound -> Websphere Portal v6.1 on WAS 7 -> Finish -> OK
属性 -> Java 构建路径 -> 库 -> 服务器库 [wps.base.v61] 未绑定 -> WAS 7 上的 Websphere Portal v6.1 -> 完成 -> 确定
回答by vaquar khan
This issue happen because of few jars are getting references from other jar and reference jar is missing .
发生此问题是因为很少有 jar 正在从其他 jar 获取引用并且缺少引用 jar。
Example : Spring framework
示例:Spring 框架
Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.beans.factory.annotation.Autowire. Fix the build path then try building this project SpringBatch Unknown Java Problem
In this case "org.springframework.beans.factory.annotation.Autowire" is missing.
在这种情况下,缺少“org.springframework.beans.factory.annotation.Autowire”。
Spring-bean.jar is missing
Once you add dependency in your class path issue will resolve.
一旦在类路径中添加依赖项,问题就会解决。