Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 14213 invoked from network); 3 Jan 2007 07:49:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jan 2007 07:49:46 -0000 Received: (qmail 39429 invoked by uid 500); 3 Jan 2007 07:49:43 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 39381 invoked by uid 500); 3 Jan 2007 07:49:43 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 39370 invoked by uid 99); 3 Jan 2007 07:49:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2007 23:49:42 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=MSGID_FROM_MTA_HEADER X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [193.93.102.40] (HELO mail.isd.dp.ua) (193.93.102.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2007 23:49:33 -0800 Message-ID: <000d01c72f0b$a947cff0$23a36cc1@isd.dp.ua> From: "Denis Bessmertnyj" To: "Jakarta Commons Users List" References: <006601c72e91$280b3ff0$23a36cc1@isd.dp.ua> <459AD0D7.9080208@apache.org> Subject: Re: Commons Logging settings Date: Wed, 3 Jan 2007 09:49:13 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 03 Jan 2007 07:49:11.0215 (UTC) FILETIME=[A7F203F0:01C72F0B] X-Scanned-By: mail.isd.dp.ua 69e1adaba9ad800ce23ab3934ae34b46b260b4e9 Received: by mail.isd.dp.ua with esmtp id 1H20s3-000F0m-EB X-Virus-Checked: Checked by ClamAV on apache.org Hi Dennis, Thank you for answer. I'm using 1.1 version. And I'm using Jdk14Logger implementation. I just made littel experement and as I see when I try to launch through JNLP without Commons Logging, problem the same. I have looked into java.util.logging.LogManager class inside (method readConfiguration() ) and here is code which reads configuration: String fname = System.getProperty("java.util.logging.config.file"); if (fname == null) { fname = System.getProperty("java.home"); if (fname == null) { throw new Error("Can't find java.home ??"); } File f = new File(fname, "lib"); f = new File(f, "logging.properties"); fname = f.getCanonicalPath(); } InputStream in = new FileInputStream(fname); BufferedInputStream bin = new BufferedInputStream(in); try { readConfiguration(bin); } finally { if (in != null) { in.close(); } As you see, they using File object here, but I have URL link jar:http://localhost:8080/newframework/lib/framework.jar!/resources/logger.cfg This small test File file = new File(new URL("jar:http://localhost:8080/newframework/lib/framework.jar!/resources/logger.cfg").toString()); FileInputStream fs = new FileInputStream(file); BufferedReader reader = new BufferedReader(new InputStreamReader(fs)); String result; while((result = reader.readLine()) != null) { System.out.println(result); } Throws an exception Exception in thread "main" java.io.FileNotFoundException: jar:http:\localhost:8080\newframework\lib\framework.jar!\resources\logger.cfg (The filename, directory name, or volume label syntax is incorrect) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at test.Test.main(Test.java:15) So, how I can use logging with Java Web Start or Applets I can't understand. :-( -- Denis Bessmertnyj ----- Original Message ----- From: "Dennis Lundberg" To: "Jakarta Commons Users List" Sent: Tuesday, January 02, 2007 11:38 PM Subject: Re: Commons Logging settings > Hi Denis > > Are you using commons-logging 1.1? There is a bug in that version which > only presents itself when you run under a security manager. We stumbled > upon this for our applets, that are also delivered as signed jars in much > the same way as you do. Perhaps this problem occurs for java web start as > well? > > We reverted back to 1.0.4 as a workaround. There is a 1.1.1 release coming > up soon, that has a fix for this bug. You might want to try a nightly > build to see if it solves your problem: > http://people.apache.org/builds/jakarta-commons/nightly/commons-logging/ > > > -- > Dennis Lundberg > > Denis Bessmertnyj wrote: >> I have software which I deliver to client through Java Web Start. >> I use Apache Commons Logging, but it doesn't work when I use it through >> Web Start, >> because it can't find config file for logger. >> I deliver my application with certificate and all permissions. >> I store config file in jar file which I also deliver to client through >> JWS. >> Here is my code of getting config file on client: >> >> ClassLoader classLoader = this.getClass().getClassLoader(); >> URL loggerConfigFileURL = >> classLoader.getResource("resources/logger.cfg"); >> System.setProperty("java.util.logging.config.file", >> loggerConfigFileURL.toString()); >> >> >> By the way, ClassLoader finds config file in jar, and >> loggerConfigFileURL var has value: >> jar:http://localhost:8080/newframework/lib/framework.jar!/resources/logger.cfg >> But logger doesn't want to work!!! It's working only if I start locally >> (not through JWS) my application and >> map "java.util.logging.config.file" to absoulute local path to logger.cfg >> file (not using URL notation). >> >> How I realize it and what I do wrong? >> >> thnx! >> >> --- >> Denis Bessmertnyj, >> GUI SoftWeb >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: commons-user-help@jakarta.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org