41

I'm getting an error message when I try to build my project in eclipse:

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!

Ryan Thames
  • 3,204
  • 6
  • 31
  • 32

5 Answers5

27

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?

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

Aniket Thakur
  • 66,731
  • 38
  • 279
  • 289
Kevin
  • 1,237
  • 1
  • 13
  • 17
  • I am having this same issue, but my class is `org.eclipse.jface.text.BadLocationException`. I cannot find the library under configure build path (libraries tab) and I cannot find **Server** under Windows->Preferences-> **Server** ->Installed runtimes. This is for an eclipse plug-in by the way, so I am in the plug-in development view on Eclipse Classic. I would appreciate any help – modulitos Jul 15 '13 at 20:40
  • 1
    Thank you! I had a similar problem with `context.getApplication().getExpressionFactory()`. I was scratching my head for a while because no class, library or library folder that I added could resolve the issue. I then used `Windows->Preferences->Server->Runtime Environments` to add Tomcat 7.0, then `Add Library->Server Runtime` and bingo! Problem went away. Another source that help identify it was a Tomcat runtime environment issue was [this article](http://www.mkyong.com/jsf2/java-lang-classnotfoundexception-javax-el-expressionfactory/). – Withheld Dec 16 '14 at 19:26
  • hello @kevin I am facing same issue for ibatis, i am using maven – VedantK May 11 '16 at 12:58
4

Add spring-tx jar file and it should settle it.

Amin
  • 107
  • 1
  • 9
3

Have you Googled for "weblogic ExpressionMap"? Do you know what it is and what it does?

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.

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".

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.

skiphoppy
  • 97,646
  • 72
  • 174
  • 218
  • 3
    because creating your own weblogic.ExpressionMap class is not a good idea. This is not solving the problem in any way, just making it go away. – Kevin Sep 22 '08 at 16:49
1

This issue happen because of few jars are getting references from other jar and reference jar is missing .

Example : Spring framework

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.

Spring-bean.jar is missing

Once you add dependency in your class path issue will resolve.

vaquar khan
  • 10,864
  • 5
  • 72
  • 96
-2

I was getting this error:

The type com.ibm.portal.state.exceptions.StateException cannot be resolved. It is indirectly referenced from required .class files

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

Emil
  • 7,220
  • 17
  • 76
  • 135
Akash
  • 1