Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 88560 invoked from network); 22 Sep 2010 15:31:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Sep 2010 15:31:50 -0000 Received: (qmail 87621 invoked by uid 500); 22 Sep 2010 15:31:49 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 87216 invoked by uid 500); 22 Sep 2010 15:31:46 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 87205 invoked by uid 99); 22 Sep 2010 15:31:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Sep 2010 15:31:44 +0000 X-ASF-Spam-Status: No, hits=4.5 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of Thomas.Rogers@oce.com does not designate 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; Wed, 22 Sep 2010 15:31:38 +0000 Received: from joe.nabble.com ([192.168.236.151]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OyRHv-0001TA-L4 for user@commons.apache.org; Wed, 22 Sep 2010 08:31:15 -0700 Date: Wed, 22 Sep 2010 08:31:15 -0700 (PDT) From: trags To: user@commons.apache.org Message-ID: <1285169475644-2550531.post@n4.nabble.com> Subject: [daemon] Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_285057_10263971.1285169475644" ------=_Part_285057_10263971.1285169475644 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I hope someone can help me with this. I am a n00b with regards to the Commons daemon, though I wrote a service years ago in c. I'm running on Windows7, 64-bit. I am registering my service with the amd64 version of prunsrv.exe, which I have copied/renamed to myapp.exe. I can run my app from a command line with... java -Dfile.encoding=Cp1252 -cp MyApp.jar com.xxxx.MyApp I have the following install service command: myapp //IS//MyApp --DisplayName="MyApp Monitor" --Description="my app" --Startup=manual ++DependsOn=MySQL --StartMode=jvm --Jvm="%JAVA_HOME%\jre\bin\server\jvm.dll" --StartClass=com.xxx.MyApp --Classpath="lib/SNMP4J.jar;lib/charsets.jar;lib/fscontext.jar;lib/jndi.jar;lib/providerutil.jar;lib/log4j-1.2.15.jar;lib/jdom.jar;lib/commons-dbcp-1.2.1.jar;lib/commons-dbutils-1.0.jar;lib/commons-lang-2.3.jar;lib/commons-pool-1.3.jar;lib/mysql-connector-java-5.0.4-bin.jar;./MyApp.jar;" ++JvmOptions="-Dfile.encoding=Cp1252" --StopTimeout=30 --LogLevel=Debug --StartPath="C:\Users\Thomas\workspace\MyApp\dist" It installs OK. When I try to manually start my service, the application launches. I put a few diagnostics at the beginning of the app, and it produces the following log: 2010-09-22 09:47:43,380 INFO MyApp main - Class Path: lib/SNMP4J.jar;lib/charsets.jar;lib/fscontext.jar;lib/jndi.jar;lib/providerutil.jar;lib/log4j-1.2.15.jar;lib/jdom.jar;lib/commons-dbcp-1.2.1.jar;lib/commons-dbutils-1.0.jar;lib/commons-lang-2.3.jar;lib/commons-pool-1.3.jar;lib/mysql-connector-java-5.0.4-bin.jar;./MyApp.jar 2010-09-22 09:47:43,380 INFO MyApp main - Lib Path: C:\Program Files\Apache-commons;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Oracle\11.1.0\client_1;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\SlikSvn\bin\;C:\oraclexe\app\oracle\product\10.2.0\server\bin 2010-09-22 09:47:43,380 INFO MyApp main - Current Dir: C:\Users\Thomas\workspace\MyApp\dist 2010-09-22 09:47:43,380 DEBUG MyApp getProperty - Get Property (key=PCM_POLLING_INTERVAL,value=2000) 2010-09-22 09:47:43,442 DEBUG MyApp getProperty - Get Property (key=INITIAL_CONTEXT_FACTORY,value=com.sun.jndi.fscontext.RefFSContextFactory) 2010-09-22 09:47:43,442 DEBUG MyApp getProperty - Get Property (key=PROVIDER_URL,value=file://C:/tmp) 2010-09-22 09:47:43,458 ERROR PCM_DataConnection - DataBase Initialization Failed: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com/sun/jndi/fscontext/RefFSContextFactory] Can anyone explain why the fscontext is incompatible? Thanks, Thomas -- View this message in context: http://apache-commons.680414.n4.nabble.com/daemon-Cannot-instantiate-class-com-sun-jndi-fscontext-RefFSContextFactory-tp2550531p2550531.html Sent from the Commons - User mailing list archive at Nabble.com. ------=_Part_285057_10263971.1285169475644--