Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6109049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:21:42+00:00 2026-05-23T14:21:42+00:00

Related: Load external properties files into EJB 3 app running on WebLogic 11 Using

  • 0

Related: Load external properties files into EJB 3 app running on WebLogic 11

Using Oracle Enterprise Pack for Eclipse, I created an Enterprise Project and named it:

PropertiesDemoEAR

Also created a PropertiesDemoEARWeb module in which I put this 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 is = 
        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 the 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 the PropertiesDemoEAR / Export / EAR file / Destination:

C:\Oracle\Middleware\user_projects\domains\MyDomain\autodeploy

When I run WebLogic 11g through Eclipse, I get this error message in the 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 the execution of deployment request 
  with ID '1309481424487' for task '0'. Error is:   
  'weblogic.management.DeploymentException: '
   weblogic.management.DeploymentException: at
   weblogic.application.internal.flow.
   BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:176) at
   weblogic.security.acl.internal.
   AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at 
   weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at
   weblogic.application.internal.flow.
   BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:104) at   
   weblogic.application.internal.
   flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
   Truncated. see log file for complete stacktrace

   Caused By: java.lang.ClassNotFoundException: 

   com.project.util.PropertiesFileHandler 

   at weblogic.utils.classloaders.
   GenericClassLoader.findLocalClass(GenericClassLoader.java:297)

Question(s):

(1) What am I possibly doing wrong? Why can’t it find my PropertiesFileHandler class?

(2) Is the location (c:/etc/error.properties) of my properties file suitable or should it be inside MyDomain directory?

(3) Is there a default directory or just simple configuration area that WebLogic loads properties files which are accessible to any application that runs in WebLogic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:21:43+00:00Added an answer on May 23, 2026 at 2:21 pm

    Got it working… The issue was that I had it set up as Web Project rather than a Java EE Utility Project in Oracle Enterprise Edition for Eclipse.

    As a web project, it was putting .class files inside WEB-INF/classes instead of APP-INF.

    Also, needed to put error.properties inside my actual domain.

    C:\Oracle\Middleware\user_projects\domains\MyDomain

    In regards to my own question:

    Is there a default directory or just simple configuration area that WebLogic loads properties files which are accessible to any application that runs in WebLogic?

    If -Dweblogic.ext.dirs is not set, it defaults to $DOMAIN/lib;$WL_HOME/common/lib/ext;$WL_HOME/server/lib/ext

    So if you store error.properties in $DOMAIN/lib it will be on the CLASSPATH and you should be able to load it using getResourceAsStream(“error.properties”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple web-service using Java. i want to load jars related
I am using Runtime.exec() to launch an external 16-bit DOS program (for legacy app
I'd like to load a JSON feed from an external source using Javascript; what's
I'm trying to load related entities of a SingleOrDefault entity, but I am getting
In what instances does Entity Framework automatically load child rows and other related rows
Related to my precedent question error when using a bundle in an iOS project
I'm having a problem when using Infragistics styles, the problem is related to the
I have a custom module, in which I want to load some use related
I am tring to Load a single Business object based on properties in its
I am using config.autoload_paths in a way very similar to this related question to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.