commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Mielke <andreasmie...@googlemail.com>
Subject Re: [DAEMON] procrun - java Property File
Date Mon, 17 Jan 2011 07:54:58 GMT
Hello JP,

I look at the files and the loading of the properties files is like me. My
problem is to tell the Apache Common Daemon where is my property file.

@ Konstantin I try the JvmOption like prunsrv //IS --Description="DMSImport"
--DisplayName="startImport" --Startup=auto --Type=interactiv
--Install=java.exe --Jvm=auto --StartMode=Java --StopMode=Java ++JvmOptions
-D=C:\Programme\DMS_ImageBrowser\DMSWrapper-binary-1.2\log4j.properties;
-D=C:\Programme\DMS_ImageBrowser\DMSWrapper-binary-1.2\DMSWrapper.properties;


But I have a FileNotFoundException.

Of Course I try ++JvmOptions
-D="C:\Programme\DMS_ImageBrowser\DMSWrapper-binary-1.2\log4j.properties;C:\Programme\DMS_ImageBrowser\DMSWrapper-binary-1.2\DMSWrapper.properties;"


But the in this case i have a ClassNotFoundException.

One point the Javaapplication is not writen by me. I have to run the program
only as awindows service.

I need a idea/Examples for the Problem.

Regards Andreas



2011/1/16 Juan Pablo Pizarro <juanpablo.pizarro@gmail.com>

> Into the zip you will find two classes. This was my post:
>
> I attached two classes to get properties from a jar. You can modify its to
> get other kind of files (I did it).
> Finally, you can get content from the package and file into the jar.
>
> In the properties case, you can get a property with something like that:
>
> private static final String LDAP_CASA =
> PropertyReaderHelper.getProperty("PROVIDER_URL_CASA");
> private static final String CASA_CONTEXT_SEARCH_1 =
> PropertyReaderHelper.getProperty("CONTEXT_SEARCH_CASA_1");
> private static final String CASA_CONTEXT_SEARCH_2 =
> PropertyReaderHelper.getProperty("CONTEXT_SEARCH_CASA_2");
> private static final String CASA_PRINCIPAL =
> PropertyReaderHelper.getProperty("PRINCIAL_CASA");
> private static final String CASA_CREDENTIALS =
> PropertyReaderHelper.getProperty("CREDENTIALS_CASA");
>
> I hope it helps you.
>
> Regards,
>
> JP
>
>
>
>
> 2011/1/16 Andreas Mielke <andreasmielke@googlemail.com>
>
>> Hello JP,
>>
>> Please write me a example?
>>
>> Andreas
>>
>>
>>
>> Am 16.01.2011 um 20:37 schrieb Juan Pablo Pizarro <
>> juanpablo.pizarro@gmail.com>:
>>
>> > Andreas, you can use a resource bundle to obtain the .properties from
>> the
>> > jar.. i mean, you put the .properties into the file and you can read
>> from
>> > it.
>> >
>> > I posted some classes to do that some months ago.
>> >
>> > Regards.
>> >
>> > JP
>> >
>> > 2011/1/16 Konstantin Kolinko <knst.kolinko@gmail.com>
>> >
>> >> 2011/1/16 Andreas Mielke <andreasmielke@googlemail.com>:
>> >>> I use Apache Common Daemon to install a java application as a windows
>> >> service. The problem is i have a java properties file to setup few
>> >> parameters and i don't know how to describe the location of the
>> property
>> >> file in the command line. My installation of the service is like
>> >>>
>> >>> prunsrv //IS//TestService --DisplayName="Test Service"
>> >> --Install=prunsrv.exe --Jvm=auto --StartMode=jvm --StopMode=jvm
>> >> --StartClass=org.apache.SomeStartClass.
>> >>>
>> >>
>> >> If you want to pass it as a system property, use "JvmOptions" [1] to
>> >> specify -D.
>> >>
>> >> Is it what you are asking? If you were running your app with
>> >> java(w).exe, what would be your command line?
>> >>
>> >> [1] http://commons.apache.org/daemon/procrun.html
>> >>
>> >> Best regards,
>> >> Konstantin Kolinko
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> >> For additional commands, e-mail: user-help@commons.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

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