Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 73535 invoked from network); 20 Jan 2009 04:35:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jan 2009 04:35:18 -0000 Received: (qmail 31011 invoked by uid 500); 20 Jan 2009 04:35:17 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 30985 invoked by uid 500); 20 Jan 2009 04:35:17 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 30976 invoked by uid 99); 20 Jan 2009 04:35:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2009 20:35:17 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2009 04:35:09 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LP8K8-0000nd-Bp for user@geronimo.apache.org; Mon, 19 Jan 2009 20:34:48 -0800 Message-ID: <21556927.post@talk.nabble.com> Date: Mon, 19 Jan 2009 20:34:48 -0800 (PST) From: "viola.lu" To: user@geronimo.apache.org Subject: Re: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory In-Reply-To: <21556399.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: viola.lu@gmail.com References: <21537474.post@talk.nabble.com> <21556399.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org 1.In eclipse, first install Geronimo Eclipse Plugin from http://geronimo.apache.org/development-tools.html, and define a Geronimo server runtime. 2.In eclipse,right-click your project, "build-path"->"library"->"add library"->"Server runtime"->choose "apache geronmo server ",then you can run your application. 3.If still class not found, you can find out more jars under Geronimo repository, and add them to classpath. Hope it can help! Thanks. Viola.Lu axiez wrote: > > Could you please tell me how to add Geronimo server runtime library? > > 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-tp21537474s134p21556927.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.