This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Classloader Order: JARs in Lib or CLASSPATH?  RSS feed

 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that is WARred up in the typical J2EE fashion. There are a bunch of 3rd party JAR files that need to be included in its lib folder. I put them in there and deployed the WAR, but when weblogic starts up it gives all these errors about not being able to find certain classes from the JARs. As an alternative, I tried putting the paths to those JARs in the CLASSPATH system variable and it worked.

Why doesn't weblogic find my JAR files if they are inside \WEB-INF\lib? Is it something to do with the order things are loaded by the classloader? Could it be that it's trying to load my classes first and the library JARs second when I put those JARs in the lib? Would it load the JARs first when I put them in the CLASSPATH instead?

Why can't it see my JARs?? >:-
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like your WAR is broken. What is the output of:

Putting third-party JAR's on the system classpath is a Bad Idea. Weblogic itself depends on a number of third-party JAR's and it's possible that your versions may introduce conflicts with Weblogic's.
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It says this:

META-INF/
META-INF/MANIFEST.MF
applet/
html/
html/gen/
html/gen/iwd/
html/gen/iwd/ZipCode/
images/
images/icons/
images/icons/task/
images/layout/
images/layout/buttons/
images/layout/menu/
images/layout/screen/
images/logo/
images/menu/
js/
jsp/
jsp/error/
jsp/gen/
jsp/gen/iwd/
jsp/gen/iwd/ZipCode/
jsp/hierarchy/
jsp/navigation/
jsp/templates/
platform/
platform/css/
platform/images/
platform/js/
platform/jsp/
platform/styles/
styles/
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/convergys/
WEB-INF/classes/com/convergys/csm/
WEB-INF/classes/com/convergys/csm/app/
WEB-INF/classes/com/convergys/csm/app/web/
WEB-INF/classes/com/convergys/csm/app/web/actions/
WEB-INF/classes/com/convergys/csm/app/web/actions/iwd/
WEB-INF/classes/com/convergys/csm/app/web/actions/iwd/zipcode/
WEB-INF/classes/com/convergys/webx/
WEB-INF/classes/com/convergys/webx/app/
WEB-INF/classes/com/convergys/webx/app/web/
WEB-INF/classes/com/convergys/webx/app/web/actions/
WEB-INF/classes/config/
WEB-INF/classes/config/web/
WEB-INF/classes/config/web/i18n/
WEB-INF/config/
WEB-INF/config/web/
WEB-INF/config/web/gen/
WEB-INF/config/web/struts/
WEB-INF/config/web/struts/gen/
WEB-INF/config/web/struts/gen/iwd/
WEB-INF/config/web/struts/gen/iwd/ZipCode/
WEB-INF/config/web/tiles/
WEB-INF/config/web/tiles/gen/
WEB-INF/config/web/tiles/gen/iwd/
WEB-INF/config/web/tiles/gen/iwd/ZipCode/
WEB-INF/config/web/tlds/
WEB-INF/config/web/validations/
WEB-INF/config/web/validations/gen/
WEB-INF/config/web/validations/gen/iwd/
WEB-INF/config/web/validations/gen/iwd/ZipCode/
WEB-INF/gen/
WEB-INF/lib/
WEB-INF/lib/pf/
applet/aopalliance.jar
applet/commons-logging.jar
applet/genHierApplet.jar
applet/log4j.jar
applet/pf-javaclient.jar
applet/spring.jar
html/gen/iwd/ZipCode/ZipCodeSearchCriteria.html
html/gen/iwd/ZipCode/ZipCodeSearchResults.html
images/clear_sh.gif
images/icons/account_d.gif
images/icons/account_e.gif
images/icons/account_icon.gif
images/icons/attention.gif
images/icons/attention_small.gif
images/icons/bcgroup_d.gif
images/icons/bcgroup_e.gif
images/icons/bcsummary_d.gif
images/icons/bcsummary_e.gif
images/icons/bc_d.gif
images/icons/bc_e.gif
images/icons/bundle_icon.gif
images/icons/calendar.png
images/icons/carte_icon.gif
images/icons/contact_e.gif
images/icons/cross.gif
images/icons/customer_d.gif
images/icons/customer_e.gif
images/icons/customer_expand_combo_d.gif
images/icons/customer_expand_combo_e.gif
images/icons/drop.gif
images/icons/expand_indicator_d.gif
images/icons/expand_indicator_e.gif
images/icons/filler_button.gif
images/icons/hierbill_e.gif
images/icons/icon_account.gif
images/icons/icon_alacarte.gif
images/icons/icon_bundle.gif
images/icons/icon_info.gif
images/icons/icon_question.gif
images/icons/icon_stop.gif
images/icons/icon_warn.gif
images/icons/icon_warn_small_inline.gif
images/icons/package_d.gif
images/icons/package_e.gif
images/icons/product_d.gif
images/icons/product_e.gif
images/icons/red_asterisk.gif
images/icons/red_asterisk2.gif
images/icons/red_asterisk_disabled.gif
images/icons/root_expand_combo_e.gif
images/icons/root_node_e.gif
images/icons/search.gif
images/icons/search_e.gif
images/icons/task/cust.png
images/icons/task/task_d.png
images/icons/task/task_nr.png
images/icons/task/task_r.png
images/icons/ungroupeditems_e.gif
images/layout/buttons/button_bg.gif
images/layout/buttons/button_hover_bg.gif
images/layout/buttons/button_inactive_bg.gif
images/layout/menu/additional_actions.gif
images/layout/menu/app_holder.jpg
images/layout/menu/arrow_down.gif
images/layout/menu/arrow_down_hilite.gif
images/layout/menu/arrow_right.gif
images/layout/menu/arrow_up.gif
images/layout/menu/arrow_up_hilite.gif
images/layout/menu/border_bottom.jpg
images/layout/menu/border_left.jpg
images/layout/menu/border_right.jpg
images/layout/menu/border_top.jpg
images/layout/menu/config_img.gif
images/layout/menu/corner_bot_left.jpg
images/layout/menu/corner_bot_right.jpg
images/layout/menu/corner_left_bottom.gif
images/layout/menu/corner_left_top.gif
images/layout/menu/corner_right_bottom.gif
images/layout/menu/corner_right_top.gif
images/layout/menu/corner_top_left.jpg
images/layout/menu/corner_top_right.jpg
images/layout/menu/corner_white_left.gif
images/layout/menu/corner_white_right.gif
images/layout/menu/csm_r1_c1.jpg
images/layout/menu/csm_r1_c2.jpg
images/layout/menu/csm_r1_c3.jpg
images/layout/menu/dot.gif
images/layout/menu/dwn_arrow.gif
images/layout/menu/dwn_arrow_lt.gif
images/layout/menu/expand.gif
images/layout/menu/full_search_ico.jpg
images/layout/menu/h2_header_bg_line.jpg
images/layout/menu/hor_bot.gif
images/layout/menu/hor_bot2.gif
images/layout/menu/hor_top.gif
images/layout/menu/hor_top_white.gif
images/layout/menu/left_header_bar.jpg
images/layout/menu/lgot_lower_left.gif
images/layout/menu/lgot_lower_right.gif
images/layout/menu/menu_bg_blue.jpg
images/layout/menu/menu_bg_white.jpg
images/layout/menu/menu_bottom_logout.jpg
images/layout/menu/menu_nav_blue.gif
images/layout/menu/menu_nav_bottom.gif
images/layout/menu/menu_nav_bottom_white.gif
images/layout/menu/menu_nav_left_side.gif
images/layout/menu/menu_nav_lower_spacer.gif
images/layout/menu/menu_nav_ride_side.gif
images/layout/menu/menu_nav_top.gif
images/layout/menu/menu_nav_top_spacer.gif
images/layout/menu/menu_top.jpg
images/layout/menu/menu_top2.jpg
images/layout/menu/middle_header_bar.jpg
images/layout/menu/right_header_bar.jpg
images/layout/menu/rt_arrow.gif
images/layout/menu/rt_arrow_lt.gif
images/layout/menu/small_vert.gif
images/layout/menu/spacer.gif
images/layout/menu/vert_black_line.png
images/layout/menu/vert_blue_left.gif
images/layout/menu/vert_blue_line.gif
images/layout/menu/vert_blue_right.gif
images/layout/menu/vert_white_left.gif
images/layout/menu/vert_white_right.gif
images/layout/screen/background.gif
images/layout/screen/fake_AH.png
images/layout/screen/fake_header.png
images/layout/screen/fake_nav.png
images/layout/screen/fake_news.gif
images/layout/screen/header.gif
images/layout/screen/login.gif
images/logo/211_bb.gif
images/logo/211_login.gif
images/logo/22_login.gif
images/logo/branding_bar_bg.gif
images/logo/branding_bar_bg.png
images/logo/branding_bar_l.gif
images/logo/branding_bar_l.png
images/logo/branding_bar_R.gif
images/logo/branding_bar_R.png
images/menu/avail_actions_d.gif
images/menu/avail_actions_e.gif
images/menu/icon_actions.png
images/menu/logo.png
js/jsCSMHierarchyFunctions.js
jsp/error/error.jsp
jsp/error/noprivError.jsp
jsp/error/wizardExpired.jsp
jsp/gen/iwd/ZipCode/ZipCodeSearchCriteria.jsp
jsp/gen/iwd/ZipCode/ZipCodeSearchResults.jsp
jsp/hierarchy/exampleNodeDetails.jsp
jsp/hierarchy/genericHierarchy.jsp
jsp/navigation/navbar.jsp
jsp/templates/brandingBar.jsp
jsp/templates/errorLayout.jsp
jsp/templates/footer.jsp
jsp/templates/header.jsp
jsp/templates/headerNoReq.jsp
jsp/templates/layout.jsp
jsp/templates/layoutNoNav.jsp
jsp/templates/layoutWithButtonPanel.jsp
jsp/templates/layoutWithButtonPanelNoNav.jsp
jsp/templates/layoutWithHierarchy.jsp
jsp/templates/layoutWithOnLoadScript.jsp
jsp/templates/messages.jsp
jsp/templates/searchLayout.jsp
jsp/templates/validationScripts.jsp
platform/css/locked_column.css
platform/css/webCalendar.css
platform/css/webCvgErrors.css
platform/css/webNavMenu.css
platform/css/webTable.css
platform/images/arrow_down.gif
platform/images/arrow_up.gif
platform/images/clear_sh.gif
platform/images/icon_warn_small_inline.gif
platform/images/menu_arrow_down.gif
platform/images/menu_arrow_right.gif
platform/images/menu_nav_bottom.gif
platform/images/menu_nav_side.gif
platform/images/menu_nav_top.gif
platform/images/vert_black_line.png
platform/images/vert_blue_line.gif
platform/images/webCalendar.gif
platform/images/webCalendarNavLeft.gif
platform/images/webCalendarNavRight.gif
platform/js/accumulatorTag.js
platform/js/performCheckAll.js
platform/jsp/brandingBar.jsp
platform/jsp/errorLayout.jsp
platform/jsp/footer.jsp
platform/jsp/header.jsp
platform/jsp/layout.jsp
platform/jsp/layoutWithNavbar.jsp
platform/jsp/layoutWithNavbarAndTable.jsp
platform/jsp/layoutWithNoPermissionNavbar.jsp
platform/jsp/layoutWithOnLoadScript.jsp
platform/jsp/loginRealm.jsp
platform/jsp/manageTimers.jsp
platform/jsp/messages.jsp
platform/jsp/navbarTst1.jsp
platform/jsp/noPermissionNavbar.jsp
platform/jsp/redirectLogin.jsp
platform/jsp/table.jsp
platform/jsp/timerDetails.jsp
platform/jsp/webCalendarI18N.jsp
platform/styles/button_style.css
platform/styles/iframe_styles.css
platform/styles/menu_style.css
platform/styles/styles.css
styles/button_style.css
styles/locked_column.css
styles/menu_style.css
styles/styles.css
WEB-INF/classes/com/convergys/csm/app/web/actions/iwd/zipcode/ZipCodeSearchCriteriaInputSvcViewAction.class
WEB-INF/classes/com/convergys/csm/app/web/actions/iwd/zipcode/ZipCodeSearchCriteriaOutputSvcRequestAction.class
WEB-INF/classes/com/convergys/csm/app/web/actions/iwd/zipcode/ZipCodeSearchResultsInputSvcViewAction.class
WEB-INF/classes/com/convergys/csm/app/web/actions/iwd/zipcode/ZipCodeSearchResultsOutputSvcRequestAction.class
WEB-INF/classes/com/convergys/webx/app/web/actions/IDatabaseController.class
WEB-INF/classes/com/convergys/webx/app/web/actions/MyNotesProcessor.class
WEB-INF/classes/com/convergys/webx/app/web/actions/MyNotesServiceProcessor.class
WEB-INF/classes/com/convergys/webx/app/web/actions/MySQLDatabaseController.class
WEB-INF/classes/com/convergys/webx/app/web/actions/QueryParam.class
WEB-INF/classes/com/convergys/webx/app/web/actions/ZipCodeServiceProcessor.class
WEB-INF/classes/com/convergys/webx/app/web/actions/ZipCodeTableProcessor.class
WEB-INF/classes/config/web/i18n/iwd.properties
WEB-INF/classes/config/web/i18n/webx.properties
WEB-INF/classes/config/web/i18n/webx_en_US.utf8
WEB-INF/classes/cvg_extensions.properties
WEB-INF/classes/pf-registry-spring.xml
WEB-INF/classes/WebLogicLauncher.class
WEB-INF/config/web/gen/zipcode-FunctionConfig.xml
WEB-INF/config/web/iwd-function-config.xml
WEB-INF/config/web/struts/gen/iwd/ZipCode/zipcode-struts-config.xml
WEB-INF/config/web/struts/hier-example-struts-config.xml
WEB-INF/config/web/struts/hierarchy-struts-config.xml
WEB-INF/config/web/struts/struts-config.xml
WEB-INF/config/web/tiles/gen/iwd/ZipCode/zipcode-tiles-defs.xml
WEB-INF/config/web/tiles/hier-example-tiles-defs.xml
WEB-INF/config/web/tiles/tiles-defs.xml
WEB-INF/config/web/tlds/cvgwsf-i18n.tld
WEB-INF/config/web/tlds/struts-bean-1.1.tld
WEB-INF/config/web/tlds/struts-bean-el.tld
WEB-INF/config/web/tlds/struts-bean.tld
WEB-INF/config/web/tlds/struts-form.tld
WEB-INF/config/web/tlds/struts-html-1.1.tld
WEB-INF/config/web/tlds/struts-html-el.tld
WEB-INF/config/web/tlds/struts-html.tld
WEB-INF/config/web/tlds/struts-logic-1.1.tld
WEB-INF/config/web/tlds/struts-logic-el.tld
WEB-INF/config/web/tlds/struts-logic.tld
WEB-INF/config/web/tlds/struts-nested-1.1.tld
WEB-INF/config/web/tlds/struts-nested.tld
WEB-INF/config/web/tlds/struts-tiles-1.1.tld
WEB-INF/config/web/tlds/struts-tiles-el.tld
WEB-INF/config/web/tlds/struts-tiles.tld
WEB-INF/config/web/tlds/struts.tld
WEB-INF/config/web/tlds/taglibs-input.tld
WEB-INF/config/web/tlds/taglibs-request.tld
WEB-INF/config/web/tlds/webx-tags.tld
WEB-INF/config/web/validation.xml
WEB-INF/config/web/validations/gen/iwd/ZipCode/zipcode-validation.xml
WEB-INF/config/web/validator-rules.xml
WEB-INF/config/web/webx-validator-rules.xml
WEB-INF/config/web/WebxFunctionConfig.xml
WEB-INF/config/web/WebxHierarchyConfig.xml
WEB-INF/config/web/WebxHierConfig.xsd
WEB-INF/config/web/WebxLocaleConfig.xml
WEB-INF/config/web/WebxLocaleConfig.xsd
WEB-INF/config/web/WebxNavigationConfig.xml
WEB-INF/gen/zipcode-web.xml
WEB-INF/gen/ZipCodeModel_1_5557-model-config.xml
WEB-INF/gen/ZipCodeModel_1_9549-model-config.xml
WEB-INF/iwd-config.xml
WEB-INF/iwd-model-config.xml
WEB-INF/iwd-table-config.xml
WEB-INF/lib/aopalliance.jar
WEB-INF/lib/axis.jar
WEB-INF/lib/commons-beanutils.jar
WEB-INF/lib/commons-collections.jar
WEB-INF/lib/commons-digester.jar
WEB-INF/lib/commons-discovery.jar
WEB-INF/lib/commons-logging.jar
WEB-INF/lib/commons-validator.jar
WEB-INF/lib/genHierApplet.jar
WEB-INF/lib/ibmxml.jar
WEB-INF/lib/ipd-interfaces.jar
WEB-INF/lib/j2ee.jar
WEB-INF/lib/jaws.jar
WEB-INF/lib/jaxb-api.jar
WEB-INF/lib/jaxb-impl.jar
WEB-INF/lib/jaxb-libs.jar
WEB-INF/lib/log4j.jar
WEB-INF/lib/mysql-connector-java-3.1.6-bin.jar
WEB-INF/lib/namespace.jar
WEB-INF/lib/pf-container.jar
WEB-INF/lib/pf-j2ee.jar
WEB-INF/lib/pf-javaclient.jar
WEB-INF/lib/pf-web.jar
WEB-INF/lib/spring.jar
WEB-INF/lib/struts-el.jar
WEB-INF/lib/struts.jar
WEB-INF/lib/taglibs-request.jar
WEB-INF/lib/webx.jar
WEB-INF/lib/xercesImpl.jar
WEB-INF/lib/xml-apis.jar
WEB-INF/model-config.xml
WEB-INF/pf-extensibleAttributes-spring.xml
WEB-INF/pf-web-spring.xml
WEB-INF/web.xml
WEB-INF/web.xml.orig
WEB-INF/weblogic.xml
WEB-INF/webx-config.xml
WEB-INF/webx-web-spring.xml
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The archive looks fine. What classes aren't being found?
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well this is what it says:


CvgActionServlet is inside of pf-web.jar. I just looked inside it with WinZip. Do you suppose it could be that it's loading the classes before it loads that library and that's what's making it crash?

[ September 08, 2006: Message edited by: Rebecca Witmer ]
[ JCE: Edited long line]
[ September 08, 2006: Message edited by: Joe Ess ]
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CvgActionServlet is obviously loaded fine, otherwise he wouldn't appear in the stack trace.
The NoSuchMethodException is usually caused by having one version of a library one compiles against (that has the getInstance method) and a different one the app runs against (that does not).
I don't suppose you have the source so you an see class CvgActionServlet is acting on.
Is CvgActionServlet an extension of the Struts ActionServlet? You may have a misconfigured struts-config.xml.
Have you tried contacting the vendor?
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you decompile the class that it is asking for it looks like this:


[JE: edited long line]
[ September 11, 2006: Message edited by: Joe Ess ]
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My struts config looks like this. XMLSpy thinks it is well-formed and validated.


[ September 08, 2006: Message edited by: Rebecca Witmer ]
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look into the code of CvgActionServlet, find the class that is having getInstance invoked on it (hint: the stack trace says it's in the initModels method) and he's the culprit. Find out where that class is coming from. Make sure that the version of that jar corresponds to the version CvgActionServlet resides in.
 
Rebecca Witmer
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems CvgActionServlet imports ModelConfig here:



And calls the getInstance method on it here:


ModelConfig seems to be in the appropriate place in the jar file and begins like this:



At the bottom of the decompiled code it declares the variable it was talking about:



It seems like the method is there...
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is ModelConfig in WEB-INF/lib/pf-web.jar?
Did you have a previous version of this com.convergys library?
Are you certain that this library is working? Have you contacted the vendor?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!