0

I'm using an exploded ear deployment layout in Weblogic to develop an app and after adding a new project to this old app, it won't deploy anymore, throwing a ClassNotFoundException when trying to load the actual application code from WEB/WEB-INF/classes.

The directory tree looks like this:

my_run 
    |
    ---- EJB
    |
    ----META-INF
    |
    ----WEB
          |
          META-INF
          |
          WEB-INF
              |
              classes
              |
              lib

Before I started on this, my colleagues were deploying successfully with all the required jar libraries in the WEB/WEB-INF/lib directory and also copied into the Weblogic domain lib directory. I figured the EJBs were causing complexities because it is EJB2.0 legacy stuff.

This way of doing it now doesn't work for me and gives me an error that Hibernate could not be loaded when I launch the server or just the app. I then tried it with Hibernate in the Weblogic domain lib and then Spring could not be loaded.

I have spent the whole 8 hours today googling the issue and have read and tried pretty much everything that can be done with Weblogic, including weblogic jar prefs xml entries which gave very bizarre xml-related class casting issues.

I tried reducing it to basics and emptying the weblogic domain lib of everything except the JDBC jars and the stuff which is required by Weblogic security etc but I failed to find a solution.

I tried using in application.xml, didn't work.

I tried putting the Class-Path entries into the MANIFEST.MF with the same results.

Surely this is not so complicated?

I am now at the point where i have all the required jars both in the WEB-INF/lib dir and in the Weblogic domain lib and the app can't find its own Hibernate pojos.

5
  • What exactly do you mean by 'adding a new project'? Commented Nov 22, 2012 at 19:24
  • I added a jar from a new project we're doing and coded against it - so I can't remove it to see if i can get back to the original state. Commented Nov 22, 2012 at 20:37
  • Hell, no version control in place? Commented Nov 23, 2012 at 7:10
  • Of course there is version control in place. The time and effort involved in going back to a previous version with this whole scenario is much greater than the effort required to work out exactly how to configure it, and wouldn't get us anywhere anyway except to prove whether the problem was or wasn't on my setup. One of my colleagues will be trying to do the same as me soon anyway so I can ask her to check that. That's why I'm asking about the config. Commented Nov 23, 2012 at 10:04
  • I had a similar issue. To diagnose it, I built the EAR via Eclipse using File > Export. I opened it up as zip and found the the WAR and JAR dependencies were not located in the /lib subdirectory of the EAR (including Spring). I then right clicked on the WAR and JAR projects and added the dependencies to the Deployment Assembly with a path of "../lib" to solve the problem. Commented Jan 7, 2013 at 12:22

1 Answer 1

1

I couldn't find an answer, and resorted to putting the necessary JAR file in the server's lib directory (user_projects/domains/{mydomain}/lib/*.jar). It seems to work, but it's a kludge of a fix. Couln't find anything better yet.

Edit: In this question, I posted a somewhat better kludge, involving setting PRE_CLASSPATH in the server startup script. Still a kludge, but the solution above broke something else on my system.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.