geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Kirby <ted.ki...@gmail.com>
Subject Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory
Date Wed, 21 Jan 2009 06:30:28 GMT
ok, I think you need these jars in your classpath:

lib/asm-2.2.3.jar
lib/asm-commons-2.2.3.jar
lib/cglib-nodep-2.1_3.jar
lib/commons-logging-1.0.4.jar
lib/geronimo-kernel-2.1.3.jar
lib/log4j-1.2.14.jar
lib/slf4j-log4j12-1.4.3.jar
lib/xpp3-1.1.3.4.O.jar
lib/xstream-1.2.2.jar
repository/backport-util-concurrent/backport-util-concurrent/2.2/backport-util-concurrent-2.2.jar
repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
repository/org/apache/activemq/activeio-core/3.0.1/activeio-core-3.0.1.jar
repository/org/apache/ant/ant-launcher/1.7.0-G589756/ant-launcher-1.7.0-G589756.jar
repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
repository/org/apache/derby/derby/10.4.1.3/derby-10.4.1.3.jar
repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/1.6/geronimo-javamail_1.4_mail-1.6.jar
repository/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.0.2/geronimo-activation_1.1_spec-1.0.2.jar
repository/org/apache/geronimo/specs/geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar
repository/org/apache/geronimo/specs/geronimo-j2ee-management_1.1_spec/1.0.1/geronimo-j2ee-management_1.1_spec-1.0.1.jar
repository/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar
repository/org/apache/geronimo/specs/geronimo-jpa_3.0_spec/1.1.1/geronimo-jpa_3.0_spec-1.1.1.jar
repository/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar
repository/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar
repository/org/objectweb/howl/howl/1.0.1-1/howl-1.0.1-1.jar
repository/org/springframework/spring-beans/2.0.5/spring-beans-2.0.5.jar
repository/org/springframework/spring-context/2.0.5/spring-context-2.0.5.jar
repository/org/springframework/spring-core/2.0.5/spring-core-2.0.5.jar


On Wed, Jan 21, 2009 at 12:37 AM, axiez <lesaient@gmail.com> wrote:
>
> Added jar. Modified code is:
> import javax.jms.*;
> import javax.naming.InitialContext;
> import java.util.*;
> import java.io.*;
> public class LogClient {
>    public static void main(String[] args) throws Exception {
>        Properties p = new Properties();
>        p.load(new FileInputStream("jndi.properties"));
>        p.put("openejb.authentication.realmName","geronimo-admin");
>
>        //Initialize JNDI
>        InitialContext ctx = new InitialContext(p);
>
>        //Lookup connection factory
>        TopicConnectionFactory factory = (TopicConnectionFactory)
> ctx.lookup("ConnectionFactory");
>
>        //Use connection factory to create JMS connection
>        TopicConnection connection = factory.createTopicConnection();
>
>        //Use connection to create a session
>        TopicSession session = connection.createTopicSession(false,
> Session.AUTO_ACKNOWLEDGE);
>
>        //lookup destination
>        Topic topic = (Topic)ctx.lookup("java:comp/env/jms/Topic");
>
>        //create a message publisher
>        TopicPublisher publisher = session.createPublisher(topic);
>
>        //create and publish a message
>        TextMessage msg = session.createTextMessage();
>        msg.setText("This is a test message");
>        publisher.send(msg);
>
>        //finish
>        publisher.close();
>        System.out.println("Message published. Please check application
> server's console to see the response from MDB");
>    }
> }
>
> jndi.properties file is:
> java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
> java.naming.provider.url=vm://localhost
> queue.MyQueue=example.MyQueue
> topic.MyTopic=example.MyTopic
> java.naming.security.principal=system
> java.naming.security.credentials=manager
>
> When I ran the program I got the following error message:
> log4j:WARN No appenders could be found for logger
> (org.apache.activemq.broker.jmx.ManagementContext).
> log4j:WARN Please initialize the log4j system properly.
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/activeio/journal/active/JournalLockedException
>
> axiez wrote:
>>
>> I have the following sample code and jndi.properties file:
>> import javax.jms.*;
>> import javax.naming.InitialContext;
>> import java.util.*;
>> import java.io.*;
>> public class LogClient {
>>     public static void main(String[] args) throws Exception {
>>         Properties p = new Properties();
>>         p.load(new FileInputStream("jndi.properties"));
>>         p.put("openejb.authentication.realmName","geronimo-admin");
>>         InitialContext ctx = new InitialContext(p);
>>         TopicConnectionFactory factory = (TopicConnectionFactory)
>> ctx.lookup("java:comp/env/jms/DefaultActiveMQConnectionFactory");
>>         TopicConnection connection = factory.createTopicConnection();
>>         TopicSession session = connection.createTopicSession(false,
>> Session.AUTO_ACKNOWLEDGE);
>>         Topic topic = (Topic)ctx.lookup("java:comp/env/jms/Topic");
>>         TopicPublisher publisher = session.createPublisher(topic);
>>         TextMessage msg = session.createTextMessage();
>>         msg.setText("This is a test message");
>>         publisher.send(msg);
>>         publisher.close();
>>         System.out.println("Message published. Please check application
>> server's console to see the response from MDB");
>>     }
>> }
>>
>> jndi.properties file:
>> java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
>> java.naming.provider.url=tcp://localhost:61616
>> java.naming.security.principal=system
>> java.naming.security.credentials=manager
>>
>> I ran the program after successful compilation. Error message is:
>> Exception in thread "main" javax.naming.NoInitialContextException: Cannot
>> instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory
>> [Root exception is java.lang.ClassNotFoundException:
>> org.apache.activemq.jndi.ActiveMQInitialContextFactory]
>>
>>
>
> --
> View this message in context: http://www.nabble.com/java.lang.ClassNotFoundException%3A-org.apache.activemq.jndi.ActiveMQInitialContextFactory-tp21537474s134p21577447.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message