java - DeploymentException & Class Not Found on WebLogic Admin Server 11g -
related: load external properties files ejb 3 app running on weblogic 11
using oracle enterprise pack eclipse, created enterprise project , named it:
propertiesdemoear
also created propertiesdemoearweb module in put code
(inside propertiesdemoearweb / java resources / src / com.project.util):
package com.project.util; public class propertiesfilehandler extends applicationlifecyclelistener { private static final string file = "c:/etc/error.properties"; public void prestart(applicationlifecycleevent evt) { system.out.println("\n\n\t\tinside prestart() method\n\n"); inputstream = evt.getapplicationcontext().getappclassloader().getresourceasstream(file); try { properties convertedprops = convertstreamtoproperties(is); string usermissingerror = convertedprops.getproperty("user_missing_error"); system.out.println("\n\n\t\tusermissingerror = " + usermissingerror + "\n\n"); } catch (throwable e) { e.printstacktrace(); } } public properties convertstreamtoproperties(inputstream is) throws ioexception { system.out.println("\n\n\t\tinside convertstreamtoproperties() method\n\n"); properties props = new properties(); if (is == null) { throw new filenotfoundexception("property file '" + file + "' not found"); } else { props.load(is); return props; } } }
inside propertiesdemoear/earcontent/meta-inf/weblogic-application.xml
i added following listener declaratively:
<?xml version="1.0" encoding="utf-8"?> <wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application" > <!--weblogic-version:10.3.5--> <wls:application-param> <wls:param-name>webapp.encoding.default</wls:param-name> <wls:param-value>utf-8</wls:param-value> </wls:application-param> <wls:listener> <wls:listener-class> com.project.util.propertiesfilehandler </wls:listener-class> </wls:listener> </wls:weblogic-application>
right clicked on propertiesdemoear / export / ear file / destination:
c:\oracle\middleware\user_projects\domains\mydomain\autodeploy
when run weblogic 11g through eclipse, error message in console:
[error] adaptermanager - servletcontaineradapter manager not initialized correctly. <oracle.tip.adapter.apps.appsconnectionfactory> connectionmanager cm: weblogic.connector.outbound.connectionmanagerimpl@12433e7-eis/apps/apps managedconnectionfactory mcf: oracle.tip.adapter.apps.appsmanagedconnectionfactory@4303022b <jun 30, 2011 5:50:24 pm pdt> <error> <deployer> <bea-149265> <failure occurred in execution of deployment request id '1309481424487' task '0'. error is: 'weblogic.management.deploymentexception: ' weblogic.management.deploymentexception: @ weblogic.application.internal.flow. baselifecycleflow$createlisteneraction.run(baselifecycleflow.java:176) @ weblogic.security.acl.internal. authenticatedsubject.doas(authenticatedsubject.java:321) @ weblogic.security.service.securitymanager.runas(securitymanager.java:120) @ weblogic.application.internal.flow. baselifecycleflow$baseaction.invoke(baselifecycleflow.java:104) @ weblogic.application.internal. flow.headlifecycleflow.createlistener(headlifecycleflow.java:117) truncated. see log file complete stacktrace caused by: java.lang.classnotfoundexception: com.project.util.propertiesfilehandler @ weblogic.utils.classloaders. genericclassloader.findlocalclass(genericclassloader.java:297)
question(s):
(1) possibly doing wrong? why can't find propertiesfilehandler class?
(2) location (c:/etc/error.properties) of properties file suitable or should inside mydomain directory?
(3) there default directory or simple configuration area weblogic loads properties files accessible application runs in weblogic?
try making sure class in /lib folder machine application being deployed.
Comments
Post a Comment