activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: debug the activeMQ-core code appear config error
Date Thu, 02 Apr 2009 10:20:37 GMT
The easiest way to get started is using maven to generate the eclipse
project for you or use the m2eclipse eclipse plugin to import the maven
project directly. ActivemMQ uses maven as the build tool.
Then you can edit the log4j properties files in the
activemq-core/../resources directory to configure logging.

Some details can be found @ http://activemq.apache.org/building.html

2009/4/2 pclovec <pclovec@gmail.com>

>
> hi, guys
>
> i'm a new developer for java . and i want to debug the activemq-core code
> when i running my test code. but i have met some resource file problem.i do
> these
> 1. download the source code from web site. unzip it
>
> 2. uses the eclipse create a project name "Activemq-core" and copy the
> source folder's org folder in src folder. copy the resource folder to
> Activemq_core folder
> the my activemq-core project folder list is
> src---org---apache--activemq--
>                                             advisory.
>                                             borker.
>                                             ......
> resources---META-INF
>                 activemq.xsd
>                 ...
>
> 3. i refer to another jar file and another library for this project. and i
> can build it.
>
> 4 i create a new test project TestActiveMQCore project and write a test
> class .and refer to ActiveMQ-core  source code . other project i refer to
> jar file (ActivemQ binrary folder /lib folder files)
>      public void Main()
>      {
>            ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(
>
> "tcp://localhost:61616");
>            Connection con = cf.createConnection();
>            con.start();
>      }
>
> 5 i copy the  the test folder's resources folder into TestActiveMQCore
> project.  and copy the log4j.properties file under  eclipse-resources
> folder into resources folder.
>
>
> 6 running my test class . i can debug into ActiveMQ_core source . but it
> can't get the config file in
>   ActiveMQPrefetchPolicy.java
>   public class ActiveMQPrefetchPolicy implements Serializable {
>       private static final Log LOG =
> LogFactory.getLog(ActiveMQPrefetchPolicy.class); //here i can get log4
> config file
>       .....
>   }
>
>   **-------------------------------------------------------
>   there is a problem why it can't load the log4 config . i copy the
> log4j.properties into resources folder
>   **-------------------------------------------------------
>
> 7. continue running the test code. and create a connection  debug here
> appear excetipn
>  org\apache\activemq\util\FactoryFinder .java
>
> private Class newInstance(Properties properties, String propertyPrefix)
> throws ClassNotFoundException, IOException {
>
>        String className = properties.getProperty(propertyPrefix + "class");
>        if (className == null) {
>            throw new IOException("Expected property is missing: " +
> propertyPrefix + "class");
>        }
>        Class clazz = null;
>        ClassLoader loader = Thread.currentThread().getContextClassLoader();
>        if (loader != null) {
>            try {
>                clazz = loader.loadClass(className);
>            } catch (ClassNotFoundException e) {
>                // ignore
>            }
>        }
>        if (clazz == null) {
>            clazz =
> FactoryFinder.class.getClassLoader().loadClass(className);
>        }
>
>        return clazz;
>    }
>
>
>
>  **-------------------------------------------------------
>  loader get null .
>   **-------------------------------------------------------
>
>
> if i switch using ActiveMQ-Core jar file than it running OK.so i want to
> know how to deploy the config i.any idea?
>
>
>
>
> thanks
> xinfnag
>
> --
> View this message in context:
> http://www.nabble.com/debug-the-activeMQ-core-code-appear-config-error-tp22839675p22839675.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message