Re: Re: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-29 Thread Mark Thomas
On 29 September 2017 16:11:01 BST, Coty Sutherland <csuth...@redhat.com> wrote:
>On Fri, Sep 29, 2017 at 10:38 AM, Wang, Jennifer
><jennifer.w...@bos.frb.org> wrote:
>> NONCONFIDENTIAL // EXTERNAL
>> Hi Coty,
>>
>> I got exactly the same error. Did you try to run it in windows? Do
>you need other MS dlls other than tcnative-1.dll? Also I down load the
>link and got as below. I updated tomcat to 8.5.20, below error is gone,
>but the no apr error came back.
>
>I haven't tried it on windows, but it should be the same.
>Possibly...in addition to tomcat-native you need the APR and the
>OpenSSL libraries (if you intend to use TLS). I'm not sure whether or
>not the tomcat-native DLL includes those libraries or not on Windows
>(it doesn't on linux).

The ones we provide are statically linked to APR and OpenSSL.

Mark

> I have APR and OpenSSL in the java.library.path
>directory that I use and after changing to 8.5.20, the quickstart
>works for me and APR is running per the following INFO lines:
>
>2017-09-29 11:07:10.617  INFO 1175 --- [   main]
>o.a.coyote.http11.Http11AprProtocol  : Initializing
>ProtocolHandler ["http-apr-8080"]
>2017-09-29 11:07:10.623  INFO 1175 --- [   main]
>o.a.coyote.http11.Http11AprProtocol  : Starting ProtocolHandler
>["http-apr-8080"]
>
>>
>> Caused by: java.lang.NoClassDefFoundError:
>org/apache/juli/logging/LogFactory
>> at
>org.apache.catalina.core.AprLifecycleListener.(AprLifecycleListener.java:49)
>
>Oops. That is my fault. I was using 8.0.36 in the quickstart which
>requires org.apache.tomcat.embed.tomcat-embed-logging in that version.
>JULI was moved into tomcat-embed-core now, so updating the pom to use
>8.5.20 resolves the CNFE for LogFactory.
>
>>
>> Thanks!
>>
>> Jennifer
>>
>> -Original Message-----
>> From: Coty Sutherland [mailto:csuth...@redhat.com]
>> Sent: Friday, September 29, 2017 8:43 AM
>> To: Tomcat Users List
>> Subject: [External] Re: Re: how to set Http11AprProtocol with
>embedded tomcat
>>
>> Here is a working quickstart (that I forgot to link yesterday) for
>APR in Spring Boot:
>>
>https://github.com/csutherl/tomcat-embedded-quickstarts/tree/master/springboot-apr-example
>>
>> On Thu, Sep 28, 2017 at 3:34 PM, Coty Sutherland
><csuth...@redhat.com> wrote:
>>> On Thu, Sep 28, 2017 at 12:27 PM, Wang, Jennifer
>>> <jennifer.w...@bos.frb.org> wrote:
>>>> NONCONFIDENTIAL // EXTERNAL
>>>> Hi Coty,
>>>>
>>>> I download tcnative-1.dll from tomcat site. I am running on windows
>7. I did set " java.library.path" as below.
>>>>
>>>>
>>>>
>>>>
>>>> @SpringBootApplication
>>>> public class Application {
>>>>
>>>> public static void main(String[] args) {
>>>>
>>>> //try both of below
>>>> System.setProperty("java.library.path",
>"C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
>>>> //System.setProperty("java.library.path",
>>>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");
>>>
>>> I think trying to set the library path in code is too late as the
>JVM
>>> has already initialized. You'll need to set it in the JVM arguments
>>> that start the Application. I got it working using the following
>>> config snippet:
>>>
>>>  
>>>  org.springframework.boot
>>>  spring-boot-maven-plugin
>>>      
>>>  
>>>  -Djava.library.path=/path/to/tomcat-native/
>>>          
>>>  
>>>
>>> and starting with `mvn spring-boot:run`. I also configured that the
>>> System.setProperty call didn't work.
>>>
>>> HTH
>>>
>>>>
>>>> SpringApplication.run(Application.class, args);
>>>> }
>>>> }
>>>>
>>>> Thanks!
>>>>
>>>> Jennifer
>>>>
>>>> -Original Message-
>>>> From: Coty Sutherland [mailto:csuth...@redhat.com]
>>>> Sent: Thursday, September 28, 2017 12:16 PM
>>>> To: Tomcat Users List
>>>> Subject: [External] Re: how to set Http11AprProtocol with embedded
>>>> tomcat
>>>>
>>>> On Thu, Sep 28, 2017 at 11:32 AM, Wan

Re: Re: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-29 Thread Coty Sutherland
On Fri, Sep 29, 2017 at 10:38 AM, Wang, Jennifer
<jennifer.w...@bos.frb.org> wrote:
> NONCONFIDENTIAL // EXTERNAL
> Hi Coty,
>
> I got exactly the same error. Did you try to run it in windows? Do you need 
> other MS dlls other than tcnative-1.dll? Also I down load the link and got as 
> below. I updated tomcat to 8.5.20, below error is gone, but the no apr error 
> came back.

I haven't tried it on windows, but it should be the same.
Possibly...in addition to tomcat-native you need the APR and the
OpenSSL libraries (if you intend to use TLS). I'm not sure whether or
not the tomcat-native DLL includes those libraries or not on Windows
(it doesn't on linux). I have APR and OpenSSL in the java.library.path
directory that I use and after changing to 8.5.20, the quickstart
works for me and APR is running per the following INFO lines:

2017-09-29 11:07:10.617  INFO 1175 --- [   main]
o.a.coyote.http11.Http11AprProtocol  : Initializing
ProtocolHandler ["http-apr-8080"]
2017-09-29 11:07:10.623  INFO 1175 --- [   main]
o.a.coyote.http11.Http11AprProtocol  : Starting ProtocolHandler
["http-apr-8080"]

>
> Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
> at 
> org.apache.catalina.core.AprLifecycleListener.(AprLifecycleListener.java:49)

Oops. That is my fault. I was using 8.0.36 in the quickstart which
requires org.apache.tomcat.embed.tomcat-embed-logging in that version.
JULI was moved into tomcat-embed-core now, so updating the pom to use
8.5.20 resolves the CNFE for LogFactory.

>
> Thanks!
>
> Jennifer
>
> -Original Message-
> From: Coty Sutherland [mailto:csuth...@redhat.com]
> Sent: Friday, September 29, 2017 8:43 AM
> To: Tomcat Users List
> Subject: [External] Re: Re: how to set Http11AprProtocol with embedded tomcat
>
> Here is a working quickstart (that I forgot to link yesterday) for APR in 
> Spring Boot:
> https://github.com/csutherl/tomcat-embedded-quickstarts/tree/master/springboot-apr-example
>
> On Thu, Sep 28, 2017 at 3:34 PM, Coty Sutherland <csuth...@redhat.com> wrote:
>> On Thu, Sep 28, 2017 at 12:27 PM, Wang, Jennifer
>> <jennifer.w...@bos.frb.org> wrote:
>>> NONCONFIDENTIAL // EXTERNAL
>>> Hi Coty,
>>>
>>> I download tcnative-1.dll from tomcat site. I am running on windows 7. I 
>>> did set " java.library.path" as below.
>>>
>>>
>>>
>>>
>>> @SpringBootApplication
>>> public class Application {
>>>
>>> public static void main(String[] args) {
>>>
>>> //try both of below
>>> System.setProperty("java.library.path", 
>>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
>>> //System.setProperty("java.library.path",
>>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");
>>
>> I think trying to set the library path in code is too late as the JVM
>> has already initialized. You'll need to set it in the JVM arguments
>> that start the Application. I got it working using the following
>> config snippet:
>>
>>  
>>  org.springframework.boot
>>  spring-boot-maven-plugin
>>  
>>  
>>  -Djava.library.path=/path/to/tomcat-native/
>>  
>>      
>>
>> and starting with `mvn spring-boot:run`. I also configured that the
>> System.setProperty call didn't work.
>>
>> HTH
>>
>>>
>>>     SpringApplication.run(Application.class, args);
>>> }
>>> }
>>>
>>> Thanks!
>>>
>>> Jennifer
>>>
>>> -Original Message-
>>> From: Coty Sutherland [mailto:csuth...@redhat.com]
>>> Sent: Thursday, September 28, 2017 12:16 PM
>>> To: Tomcat Users List
>>> Subject: [External] Re: how to set Http11AprProtocol with embedded
>>> tomcat
>>>
>>> On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer 
>>> <jennifer.w...@bos.frb.org> wrote:
>>>> NONCONFIDENTIAL // EXTERNAL
>>>> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>>>>
>>>> I keep get below error.
>>>
>>> You don't have tomcat-native installed. Resolving the problem should be as 
>>> simple as installing tomcat-native (which deps on APR) via RPM (assuming 
>>> you're on linux) so that it's on your library path or u

RE: Re: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-29 Thread Wang, Jennifer
NONCONFIDENTIAL // EXTERNAL
Hi Coty,

I got exactly the same error. Did you try to run it in windows? Do you need 
other MS dlls other than tcnative-1.dll? Also I down load the link and got as 
below. I updated tomcat to 8.5.20, below error is gone, but the no apr error 
came back.

Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at 
org.apache.catalina.core.AprLifecycleListener.(AprLifecycleListener.java:49)

Thanks!

Jennifer

-Original Message-
From: Coty Sutherland [mailto:csuth...@redhat.com] 
Sent: Friday, September 29, 2017 8:43 AM
To: Tomcat Users List
Subject: [External] Re: Re: how to set Http11AprProtocol with embedded tomcat

Here is a working quickstart (that I forgot to link yesterday) for APR in 
Spring Boot:
https://github.com/csutherl/tomcat-embedded-quickstarts/tree/master/springboot-apr-example

On Thu, Sep 28, 2017 at 3:34 PM, Coty Sutherland <csuth...@redhat.com> wrote:
> On Thu, Sep 28, 2017 at 12:27 PM, Wang, Jennifer 
> <jennifer.w...@bos.frb.org> wrote:
>> NONCONFIDENTIAL // EXTERNAL
>> Hi Coty,
>>
>> I download tcnative-1.dll from tomcat site. I am running on windows 7. I did 
>> set " java.library.path" as below.
>>
>>
>>
>>
>> @SpringBootApplication
>> public class Application {
>>
>> public static void main(String[] args) {
>>
>> //try both of below
>> System.setProperty("java.library.path", 
>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
>> //System.setProperty("java.library.path", 
>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");
>
> I think trying to set the library path in code is too late as the JVM 
> has already initialized. You'll need to set it in the JVM arguments 
> that start the Application. I got it working using the following 
> config snippet:
>
>  
>  org.springframework.boot
>  spring-boot-maven-plugin
>  
>  
>  -Djava.library.path=/path/to/tomcat-native/
>  
>  
>
> and starting with `mvn spring-boot:run`. I also configured that the 
> System.setProperty call didn't work.
>
> HTH
>
>>
>> SpringApplication.run(Application.class, args);
>> }
>> }
>>
>> Thanks!
>>
>> Jennifer
>>
>> -Original Message-
>> From: Coty Sutherland [mailto:csuth...@redhat.com]
>> Sent: Thursday, September 28, 2017 12:16 PM
>> To: Tomcat Users List
>> Subject: [External] Re: how to set Http11AprProtocol with embedded 
>> tomcat
>>
>> On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer <jennifer.w...@bos.frb.org> 
>> wrote:
>>> NONCONFIDENTIAL // EXTERNAL
>>> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>>>
>>> I keep get below error.
>>
>> You don't have tomcat-native installed. Resolving the problem should be as 
>> simple as installing tomcat-native (which deps on APR) via RPM (assuming 
>> you're on linux) so that it's on your library path or updating your JVM's 
>> -Djava.library.path system property to point to APR and tomcat-native so 
>> that tomcat can use it.
>>
>>> org.apache.catalina.LifecycleException: Failed to initialize component 
>>> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>>>at 
>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>>>at 
>>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>>>at 
>>> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>>>at 
>>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>>>at 
>>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>>>at 
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicat

RE: Re: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-29 Thread Wang, Jennifer
NONCONFIDENTIAL // EXTERNAL
Hi Coty,

I got exactly the same error. Did you try to run it in windows? Do you need 
other MS dlls other than tcnative-1.dll? Also I down load the link and got as 
below. I updated tomcat to 8.5.20, below error is gone, but the no apr error 
came back.

Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at 
org.apache.catalina.core.AprLifecycleListener.(AprLifecycleListener.java:49)

Thanks!

Jennifer

-Original Message-
From: Coty Sutherland [mailto:csuth...@redhat.com] 
Sent: Friday, September 29, 2017 8:43 AM
To: Tomcat Users List
Subject: [External] Re: Re: how to set Http11AprProtocol with embedded tomcat

Here is a working quickstart (that I forgot to link yesterday) for APR in 
Spring Boot:
https://github.com/csutherl/tomcat-embedded-quickstarts/tree/master/springboot-apr-example

On Thu, Sep 28, 2017 at 3:34 PM, Coty Sutherland <csuth...@redhat.com> wrote:
> On Thu, Sep 28, 2017 at 12:27 PM, Wang, Jennifer 
> <jennifer.w...@bos.frb.org> wrote:
>> NONCONFIDENTIAL // EXTERNAL
>> Hi Coty,
>>
>> I download tcnative-1.dll from tomcat site. I am running on windows 7. I did 
>> set " java.library.path" as below.
>>
>>
>>
>>
>> @SpringBootApplication
>> public class Application {
>>
>> public static void main(String[] args) {
>>
>> //try both of below
>> System.setProperty("java.library.path", 
>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
>> //System.setProperty("java.library.path", 
>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");
>
> I think trying to set the library path in code is too late as the JVM 
> has already initialized. You'll need to set it in the JVM arguments 
> that start the Application. I got it working using the following 
> config snippet:
>
>  
>  org.springframework.boot
>  spring-boot-maven-plugin
>  
>  
>  -Djava.library.path=/path/to/tomcat-native/
>  
>  
>
> and starting with `mvn spring-boot:run`. I also configured that the 
> System.setProperty call didn't work.
>
> HTH
>
>>
>> SpringApplication.run(Application.class, args);
>> }
>> }
>>
>> Thanks!
>>
>> Jennifer
>>
>> -Original Message-
>> From: Coty Sutherland [mailto:csuth...@redhat.com]
>> Sent: Thursday, September 28, 2017 12:16 PM
>> To: Tomcat Users List
>> Subject: [External] Re: how to set Http11AprProtocol with embedded 
>> tomcat
>>
>> On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer <jennifer.w...@bos.frb.org> 
>> wrote:
>>> NONCONFIDENTIAL // EXTERNAL
>>> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>>>
>>> I keep get below error.
>>
>> You don't have tomcat-native installed. Resolving the problem should be as 
>> simple as installing tomcat-native (which deps on APR) via RPM (assuming 
>> you're on linux) so that it's on your library path or updating your JVM's 
>> -Djava.library.path system property to point to APR and tomcat-native so 
>> that tomcat can use it.
>>
>>> org.apache.catalina.LifecycleException: Failed to initialize component 
>>> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>>>at 
>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>>>at 
>>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>>>at 
>>> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>>>at 
>>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>>>at 
>>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>>>at 
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicat

Re: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-29 Thread Coty Sutherland
Here is a working quickstart (that I forgot to link yesterday) for APR
in Spring Boot:
https://github.com/csutherl/tomcat-embedded-quickstarts/tree/master/springboot-apr-example

On Thu, Sep 28, 2017 at 3:34 PM, Coty Sutherland <csuth...@redhat.com> wrote:
> On Thu, Sep 28, 2017 at 12:27 PM, Wang, Jennifer
> <jennifer.w...@bos.frb.org> wrote:
>> NONCONFIDENTIAL // EXTERNAL
>> Hi Coty,
>>
>> I download tcnative-1.dll from tomcat site. I am running on windows 7. I did 
>> set " java.library.path" as below.
>>
>>
>>
>>
>> @SpringBootApplication
>> public class Application {
>>
>> public static void main(String[] args) {
>>
>> //try both of below
>> System.setProperty("java.library.path", 
>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
>> //System.setProperty("java.library.path", 
>> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");
>
> I think trying to set the library path in code is too late as the JVM
> has already initialized. You'll need to set it in the JVM arguments
> that start the Application. I got it working using the following
> config snippet:
>
>  
>  org.springframework.boot
>  spring-boot-maven-plugin
>  
>  
>  -Djava.library.path=/path/to/tomcat-native/
>  
>  
>
> and starting with `mvn spring-boot:run`. I also configured that the
> System.setProperty call didn't work.
>
> HTH
>
>>
>> SpringApplication.run(Application.class, args);
>> }
>> }
>>
>> Thanks!
>>
>> Jennifer
>>
>> -Original Message-
>> From: Coty Sutherland [mailto:csuth...@redhat.com]
>> Sent: Thursday, September 28, 2017 12:16 PM
>> To: Tomcat Users List
>> Subject: [External] Re: how to set Http11AprProtocol with embedded tomcat
>>
>> On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer <jennifer.w...@bos.frb.org> 
>> wrote:
>>> NONCONFIDENTIAL // EXTERNAL
>>> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>>>
>>> I keep get below error.
>>
>> You don't have tomcat-native installed. Resolving the problem should be as 
>> simple as installing tomcat-native (which deps on APR) via RPM (assuming 
>> you're on linux) so that it's on your library path or updating your JVM's 
>> -Djava.library.path system property to point to APR and tomcat-native so 
>> that tomcat can use it.
>>
>>> org.apache.catalina.LifecycleException: Failed to initialize component 
>>> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>>>at 
>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>>>at 
>>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>>>at 
>>> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>>>at 
>>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>>>at 
>>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>>>at 
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>>>at 
>>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>>>at 
>>> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
>>>at 
>>> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
>>>at 
>>> org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
>>>at 
>>> org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
>>>at 
>>> org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
>>>at hello.Application.main(Application.java:13)
>>> Caused by: org.apache.catalina.LifecycleException: The configured
>>> protocol [org.apache.coyote.http11.Http11AprProtocol] requires the
>>> APR/native library which is not available
>>>
>>> Thanks!
>>>
>>> Jennifer
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-28 Thread Coty Sutherland
On Thu, Sep 28, 2017 at 12:27 PM, Wang, Jennifer
<jennifer.w...@bos.frb.org> wrote:
> NONCONFIDENTIAL // EXTERNAL
> Hi Coty,
>
> I download tcnative-1.dll from tomcat site. I am running on windows 7. I did 
> set " java.library.path" as below.
>
>
>
>
> @SpringBootApplication
> public class Application {
>
> public static void main(String[] args) {
>
> //try both of below
> System.setProperty("java.library.path", 
> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
> //System.setProperty("java.library.path", 
> "C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");

I think trying to set the library path in code is too late as the JVM
has already initialized. You'll need to set it in the JVM arguments
that start the Application. I got it working using the following
config snippet:

 
 org.springframework.boot
 spring-boot-maven-plugin
 
 
 -Djava.library.path=/path/to/tomcat-native/
 
 

and starting with `mvn spring-boot:run`. I also configured that the
System.setProperty call didn't work.

HTH

>
> SpringApplication.run(Application.class, args);
> }
> }
>
> Thanks!
>
> Jennifer
>
> -Original Message-
> From: Coty Sutherland [mailto:csuth...@redhat.com]
> Sent: Thursday, September 28, 2017 12:16 PM
> To: Tomcat Users List
> Subject: [External] Re: how to set Http11AprProtocol with embedded tomcat
>
> On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer <jennifer.w...@bos.frb.org> 
> wrote:
>> NONCONFIDENTIAL // EXTERNAL
>> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>>
>> I keep get below error.
>
> You don't have tomcat-native installed. Resolving the problem should be as 
> simple as installing tomcat-native (which deps on APR) via RPM (assuming 
> you're on linux) so that it's on your library path or updating your JVM's 
> -Djava.library.path system property to point to APR and tomcat-native so that 
> tomcat can use it.
>
>> org.apache.catalina.LifecycleException: Failed to initialize component 
>> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>>at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>>at 
>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>>at 
>> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>>at 
>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>>at 
>> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>>at 
>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>>at 
>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>>at 
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>>at 
>> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>>at 
>> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
>>at 
>> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
>>at 
>> org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
>>at 
>> org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
>>at 
>> org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
>>at hello.Application.main(Application.java:13)
>> Caused by: org.apache.catalina.LifecycleException: The configured
>> protocol [org.apache.coyote.http11.Http11AprProtocol] requires the
>> APR/native library which is not available
>>
>> Thanks!
>>
>> Jennifer
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-28 Thread Wang, Jennifer
NONCONFIDENTIAL // EXTERNAL
Hi Coty,

I download tcnative-1.dll from tomcat site. I am running on windows 7. I did 
set " java.library.path" as below.




@SpringBootApplication
public class Application {

public static void main(String[] args) {

//try both of below
System.setProperty("java.library.path", 
"C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
//System.setProperty("java.library.path", 
"C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");

SpringApplication.run(Application.class, args);
}
}

Thanks!

Jennifer

-Original Message-
From: Coty Sutherland [mailto:csuth...@redhat.com] 
Sent: Thursday, September 28, 2017 12:16 PM
To: Tomcat Users List
Subject: [External] Re: how to set Http11AprProtocol with embedded tomcat

On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer <jennifer.w...@bos.frb.org> 
wrote:
> NONCONFIDENTIAL // EXTERNAL
> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>
> I keep get below error.

You don't have tomcat-native installed. Resolving the problem should be as 
simple as installing tomcat-native (which deps on APR) via RPM (assuming you're 
on linux) so that it's on your library path or updating your JVM's 
-Djava.library.path system property to point to APR and tomcat-native so that 
tomcat can use it.

> org.apache.catalina.LifecycleException: Failed to initialize component 
> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>at 
> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>at 
> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>at 
> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>at 
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
>at 
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
>at hello.Application.main(Application.java:13)
> Caused by: org.apache.catalina.LifecycleException: The configured 
> protocol [org.apache.coyote.http11.Http11AprProtocol] requires the 
> APR/native library which is not available
>
> Thanks!
>
> Jennifer
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Re: how to set Http11AprProtocol with embedded tomcat

2017-09-28 Thread Wang, Jennifer
NONCONFIDENTIAL // EXTERNAL
Hi Coty,

I download tcnative-1.dll from tomcat site. I am running on windows 7. I did 
set " java.library.path" as below.




@SpringBootApplication
public class Application {

public static void main(String[] args) {

//try both of below
System.setProperty("java.library.path", 
"C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64\\tcnative-1.dll");
//System.setProperty("java.library.path", 
"C:\\Temp\\tomcat-native-1.2.14-win32-bin\\bin\\x64");

SpringApplication.run(Application.class, args);
}
}

Thanks!

Jennifer

-Original Message-
From: Coty Sutherland [mailto:csuth...@redhat.com] 
Sent: Thursday, September 28, 2017 12:16 PM
To: Tomcat Users List
Subject: [External] Re: how to set Http11AprProtocol with embedded tomcat

On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer <jennifer.w...@bos.frb.org> 
wrote:
> NONCONFIDENTIAL // EXTERNAL
> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>
> I keep get below error.

You don't have tomcat-native installed. Resolving the problem should be as 
simple as installing tomcat-native (which deps on APR) via RPM (assuming you're 
on linux) so that it's on your library path or updating your JVM's 
-Djava.library.path system property to point to APR and tomcat-native so that 
tomcat can use it.

> org.apache.catalina.LifecycleException: Failed to initialize component 
> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>at 
> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>at 
> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>at 
> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>at 
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
>at 
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
>at hello.Application.main(Application.java:13)
> Caused by: org.apache.catalina.LifecycleException: The configured 
> protocol [org.apache.coyote.http11.Http11AprProtocol] requires the 
> APR/native library which is not available
>
> Thanks!
>
> Jennifer
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how to set Http11AprProtocol with embedded tomcat

2017-09-28 Thread Coty Sutherland
On Thu, Sep 28, 2017 at 11:32 AM, Wang, Jennifer
<jennifer.w...@bos.frb.org> wrote:
> NONCONFIDENTIAL // EXTERNAL
> How to set Http11AprProtocol with embedded tomcat in java spring boot app?
>
> I keep get below error.

You don't have tomcat-native installed. Resolving the problem should
be as simple as installing tomcat-native (which deps on APR) via RPM
(assuming you're on linux) so that it's on your library path or
updating your JVM's -Djava.library.path system property to point to
APR and tomcat-native so that tomcat can use it.

> org.apache.catalina.LifecycleException: Failed to initialize component 
> [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
>at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
>at 
> org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
>at 
> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
>at 
> org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
>at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>at 
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
>at 
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
>at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
>at hello.Application.main(Application.java:13)
> Caused by: org.apache.catalina.LifecycleException: The configured protocol 
> [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library 
> which is not available
>
> Thanks!
>
> Jennifer
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



how to set Http11AprProtocol with embedded tomcat

2017-09-28 Thread Wang, Jennifer
NONCONFIDENTIAL // EXTERNAL
How to set Http11AprProtocol with embedded tomcat in java spring boot app?

I keep get below error.


org.apache.catalina.LifecycleException: Failed to initialize component 
[Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
   at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
   at 
org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
   at 
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
   at 
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
   at 
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
   at 
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
   at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
   at 
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
   at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
   at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
   at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
   at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
   at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
   at hello.Application.main(Application.java:13)
Caused by: org.apache.catalina.LifecycleException: The configured protocol 
[org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library 
which is not available

Thanks!

Jennifer



how to set Http11AprProtocol with embedded tomcat

2017-09-28 Thread Wang, Jennifer
NONCONFIDENTIAL // EXTERNAL
How to set Http11AprProtocol with embedded tomcat in java spring boot app?

I keep get below error.


org.apache.catalina.LifecycleException: Failed to initialize component 
[Connector[org.apache.coyote.http11.Http11AprProtocol-8443]]
   at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
   at 
org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
   at 
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
   at 
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
   at 
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
   at 
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
   at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
   at 
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
   at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
   at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
   at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
   at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
   at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
   at hello.Application.main(Application.java:13)
Caused by: org.apache.catalina.LifecycleException: The configured protocol 
[org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library 
which is not available

Thanks!

Jennifer