Re: Start embedded Tomcat 9.0.1 server from java code

2017-11-07 Thread Tobias Soloschenko
Thanks for the hints! :-)

kind regards

Tobias

> Am 08.11.2017 um 07:49 schrieb Rémy Maucherat <r...@apache.org>:
> 
> On Wed, Nov 8, 2017 at 5:30 AM, Maxim Solodovnik <solomax...@gmail.com>
> wrote:
> 
>> OK :)
>> I finally found the difference :)))
>> 
>> Tomcat.java 8.5.23:
>>public void start() throws LifecycleException {
>>getServer();
>>getConnector();
>>server.start();
>>}
>> 
>> Tomcat.java 9.0.1:
>>public void start() throws LifecycleException {
>>getServer();
>>server.start();
>>}
>> 
>> This is why Tomcat 9.0.2 has no connectors 
>> Is it bug or feature?
>> 
> 
> The automatic connector creation, among other tings, was conflicting with
> other more sophisticated uses so it was refactored. It was not possible to
> start Tomcat without a connector so that capability was added in Tomcat 9.
> If you want to get a default connector, you have to call getConnector
> yourself.
> BZ60297, BZ60368, then a Tomcat 9 specific change.
> 
> Rémy
> 
>> 
>> 
>> On Wed, Nov 8, 2017 at 12:07 AM, Tobias Soloschenko <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> Hi Maxim,
>>> 
>>> same for me I just created a simple setup like this:
>>> 
>>>String baseDir =".";
>>>String webappDirLocation = "src/main/webapp/";
>>>String webxmlDirLocation = "src/main/webapp/WEB-INF/web.xml";
>>>Tomcat tomcat = new Tomcat();
>>>tomcat.setPort(8080);
>>>tomcat.setBaseDir(baseDir);
>>>tomcat.getHost().setAppBase(baseDir);
>>>tomcat.getHost().setDeployOnStartup(true);
>>>tomcat.getHost().setAutoDeploy(true);
>>>tomcat.enableNaming();
>>>StandardContext ctx = (StandardContext)
>>> tomcat.addWebapp("/project", new File(webappDirLocation).
>>> getAbsolutePath());
>>>File additionWebInfClasses = new File("target/classes");
>>>WebResourceRoot resources = new StandardRoot(ctx);
>>>resources.addPreResources(new DirResourceSet(resources,
>>> "/WEB-INF/classes",
>>>additionWebInfClasses.getAbsolutePath(), "/"));
>>>ctx.setResources(resources);
>>>ctx.setDefaultWebXml(new File(webxmlDirLocation).
>>> getAbsolutePath());
>>>tomcat.start();
>>>tomcat.getServer().await();
>>> 
>>> I just placed in a Servlet into my classpath and applied the mapping in
>>> the web.xml - with the dependencies of tomcat-embed-core and
>>> tomcat-embed-jasper of version 9.0.1 it is not working and with 8.5.23 it
>>> does.
>>> 
>>> Here is the log of both.
>>> 
>>> 8.5.23
>>> 
>>> Nov. 07, 2017 6:02:44 NACHM. org.apache.coyote.AbstractProtocol init
>>> INFORMATION: Initializing ProtocolHandler ["http-nio-8080"]
>>> Nov. 07, 2017 6:02:44 NACHM. org.apache.tomcat.util.net.NioSelectorPool
>>> getSharedSelector
>>> INFORMATION: Using a shared selector for servlet write/read
>>> Nov. 07, 2017 6:02:44 NACHM. org.apache.catalina.core.StandardService
>>> startInternal
>>> INFORMATION: Starting service [Tomcat]
>>> Nov. 07, 2017 6:02:44 NACHM. org.apache.catalina.core.StandardEngine
>>> startInternal
>>> INFORMATION: Starting Servlet Engine: Apache Tomcat/8.5.23
>>> Nov. 07, 2017 6:02:44 NACHM. org.apache.catalina.startup.ContextConfig
>>> getDefaultWebXmlFragment
>>> INFORMATION: No global web.xml found
>>> Nov. 07, 2017 6:02:45 NACHM. org.apache.coyote.AbstractProtocol start
>>> INFORMATION: Starting ProtocolHandler ["http-nio-8080“]
>>> 
>>> 9.0.1
>>> 
>>> Nov. 07, 2017 6:06:56 NACHM. org.apache.catalina.core.StandardService
>>> startInternal
>>> INFORMATION: Starting service [Tomcat]
>>> Nov. 07, 2017 6:06:56 NACHM. org.apache.catalina.core.StandardEngine
>>> startInternal
>>> INFORMATION: Starting Servlet Engine: Apache Tomcat/9.0.1
>>> Nov. 07, 2017 6:06:56 NACHM. org.apache.catalina.startup.ContextConfig
>>> getDefaultWebXmlFragment
>>> INFORMATION: No global web.xml found
>>> 
>>> kind regards
>>> 
>>> Tobias
>>> 
>>>> Am 07.11.2017 um 15:56 schrieb Maxim Solodovnik <solomax...@gmail.com
>>> :
>>>> 
>>

Re: Start embedded Tomcat 9.0.1 server from java code

2017-11-07 Thread Tobias Soloschenko
Hi Maxim,

same for me I just created a simple setup like this:

String baseDir =".";
String webappDirLocation = "src/main/webapp/";
String webxmlDirLocation = "src/main/webapp/WEB-INF/web.xml";
Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
tomcat.setBaseDir(baseDir);
tomcat.getHost().setAppBase(baseDir);
tomcat.getHost().setDeployOnStartup(true);
tomcat.getHost().setAutoDeploy(true);
tomcat.enableNaming();
StandardContext ctx = (StandardContext) tomcat.addWebapp("/project", 
new File(webappDirLocation).getAbsolutePath());
File additionWebInfClasses = new File("target/classes");
WebResourceRoot resources = new StandardRoot(ctx);
resources.addPreResources(new DirResourceSet(resources, 
"/WEB-INF/classes",
additionWebInfClasses.getAbsolutePath(), "/"));
ctx.setResources(resources);
ctx.setDefaultWebXml(new File(webxmlDirLocation).getAbsolutePath());
tomcat.start();
tomcat.getServer().await();

I just placed in a Servlet into my classpath and applied the mapping in the 
web.xml - with the dependencies of tomcat-embed-core and tomcat-embed-jasper of 
version 9.0.1 it is not working and with 8.5.23 it does.

Here is the log of both.

8.5.23

Nov. 07, 2017 6:02:44 NACHM. org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["http-nio-8080"]
Nov. 07, 2017 6:02:44 NACHM. org.apache.tomcat.util.net.NioSelectorPool 
getSharedSelector
INFORMATION: Using a shared selector for servlet write/read
Nov. 07, 2017 6:02:44 NACHM. org.apache.catalina.core.StandardService 
startInternal
INFORMATION: Starting service [Tomcat]
Nov. 07, 2017 6:02:44 NACHM. org.apache.catalina.core.StandardEngine 
startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/8.5.23
Nov. 07, 2017 6:02:44 NACHM. org.apache.catalina.startup.ContextConfig 
getDefaultWebXmlFragment
INFORMATION: No global web.xml found
Nov. 07, 2017 6:02:45 NACHM. org.apache.coyote.AbstractProtocol start
INFORMATION: Starting ProtocolHandler ["http-nio-8080“]

9.0.1

Nov. 07, 2017 6:06:56 NACHM. org.apache.catalina.core.StandardService 
startInternal
INFORMATION: Starting service [Tomcat]
Nov. 07, 2017 6:06:56 NACHM. org.apache.catalina.core.StandardEngine 
startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/9.0.1
Nov. 07, 2017 6:06:56 NACHM. org.apache.catalina.startup.ContextConfig 
getDefaultWebXmlFragment
INFORMATION: No global web.xml found

kind regards

Tobias

> Am 07.11.2017 um 15:56 schrieb Maxim Solodovnik :
> 
> Thanks for the hints :)
> 
> I have created sample project: https://github.com/solomax/tomcat-from-java
> 
> I have compared detailed logs.
> 
> Following lines appears in logs while Tomcat8 is used
> Nov 07, 2017 9:1 PM org.apache.catalina.util.LifecycleBase
> setStateInternal
> FINE: Setting state for [Connector[HTTP/1.1-8080]] to
> [INITIALIZING]
> Nov 07, 2017 9:1 PM org.apache.tomcat.util.modeler.Registry
> registerComponent
> FINE: Managed= Tomcat:type=Connector,port=8080
> 
> These lines are missing while Tomcat9 is used
> 
> Maybe you can tell me why?
> 
> On Mon, Nov 6, 2017 at 7:55 PM, Mark Thomas  wrote:
> 
>> On 04/11/17 15:25, Maxim Solodovnik wrote:
>>> Maybe I can set breakpoint somewhere? and check what is wrong?
>>> Could you point me to the correct class?
>> 
>> No idea where to look at this point. I'd probably start with the start()
>> method and go from there.
>> 
>> Maybe try turning on debug logging?
>> 
>> Mark
>> 
>> 
>>> 
>>> On Fri, Nov 3, 2017 at 5:26 PM, Maxim Solodovnik 
>>> wrote:
>>> 
 I'm OK to add missing code to my tests,
 but I'm not sure what need to be added :(
 
 On Fri, Nov 3, 2017 at 3:24 PM, Maxim Solodovnik 
 wrote:
 
> I see no errors,
> Using debugger I can see tomcat.server.state == STARTED
> 
> Everything works as expected if I'm switching back to 8.5.23 without
>> any
> other changes
> 
> nestat reports:
> *netstat -an |grep 8080*
> tcp6   0  0 :::8080 :::*
> LISTEN
> 
> for 8.5.23
> 
> 
> On Fri, Nov 3, 2017 at 3:08 PM, Mark Thomas  wrote:
> 
>> On 03/11/17 04:51, Maxim Solodovnik wrote:
>>> Hello,
>>> 
>>> I recently migrated from Tomcat 8.5.23 to Tomcat 9.0.1
>>> Everything works as expected except tests :(
>>> 
>>> I'm using following code to start embedded Tomcat and test CXF web
>> services [1].
>>> With Tomcat 9.0.1 tests failed, netstat -an displays port 8080 is not
>>> being listened
>>> What need to be changed?
>> 
>> If Tomcat isn't listening then there should be an exception or error
>> message reported at some point. Do you see anything in the logs?
>> 
>> Mark
>> 
>> 

Re: Developer quickstart guide for Tomcat with HTTP/2 on macOS

2017-06-01 Thread Tobias Soloschenko
Christopher,

> Am 01.06.2017 um 16:33 schrieb Christopher Schultz 
> <ch...@christopherschultz.net>:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> Tobias,
> 
>> On 6/1/17 3:53 AM, Tobias Soloschenko wrote:
>> a long time ago I tried out to install Apache Tomcat with HTTP/2
>> support on macOS. I finally got a short time window to complete a
>> developer quickstart guide for that:
> 
> Wouldn't this all be a lot easier if you used the NIO connector
> instead of APR? No XCode/OpenSSL/tcnative necessary.
> 
>> 1. Download XCode from the AppStore
>> 
>> 
>> 2. Install Brew: http://brew.sh/
>> 
>> 
>> 3. Download Apache Tomcat binaries > 8.5 http://tomcat.apache.org/
>> 
>> 
>> 4. Install APR and OPENSSL with “brew install openssl” and “brew
>> install apr”
>> 
>> 
>> 5. Create pem files in “apache-tomcat-8.5.15/conf” folder - use
>> “changeit” every time a password is going to be requested (The
>> commands can be executed separately or within a shell script):
>> 
>> /usr/local/Cellar/openssl/1.0.2l/bin/openssl genrsa -des3 -out 
>> localhost-rsa-key 1024
>> 
>> /usr/local/Cellar/openssl/1.0.2l/bin/openssl genrsa -out
>> localhost-key 1024
>> 
>> /usr/local/Cellar/openssl/1.0.2l/bin/openssl rsa -in
>> localhost-rsa-key -out localhost-key
>> 
>> /usr/local/Cellar/openssl/1.0.2l/bin/openssl req -new -key
>> localhost-key -out localhost-csr
>> 
>> /usr/local/Cellar/openssl/1.0.2l/bin/openssl x509 -req -days 365
>> -in localhost-csr -signkey localhost-key -out localhost-crt
>> 
>> cat localhost-key localhost-crt > localhost-rsa-cert.pem
>> 
>> cat localhost-rsa-cert.pem > localhost-rsa-chain.pem
>> 
>> cat localhost-rsa-key > localhost-rsa-key-mod.pem
>> 
>> /usr/local/Cellar/openssl/1.0.2l/bin/openssl rsa -in 
>> localhost-rsa-key-mod.pem -out localhost-rsa-key.pem
>> 
>> 
>> 6. Uncomment the http/2 connector with protocol 
>> “org.apache.coyote.http11.Http11AprProtocol” in the 
>> "apache-tomcat-8.5.15/conf/server.xml"
>> 
>> 
>> 7. Tomcat native installation
>> 
>> Extract “apache-tomcat-8.5.15/bin/tomcat-native.tar.gz”
>> 
>> Go into folder
>> “apache-tomcat-8.5.15/bin/tomcat-native-1.2.12-src/native”
>> 
>> Run “./configure --with-apr=/usr/local/Cellar/apr/1.5.2_3/ 
>> --with-ssl=/usr/local/Cellar/openssl/1.0.2l”
>> 
>> Run “make”
>> 
>> 
>> 8. Create a setenv.sh file within the /bin folder and add
>> lines:
>> 
>> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Cellar/apr/1.5.2_3/libexec
> /lib:/Applications/apache-tomcat-8.5.15/bin/tomcat-native-1.2.12-src/nat
> ive/.libs
>> 
>> 
>> JAVA_OPTS="-Djava.library.path=/usr/local/Cellar/apr/1.5.2_3/libexec/l
> ib:/Applications/apache-tomcat-8.5.15/bin/tomcat-native-1.2.12-src/nativ
> e/.libs"
>> 
>> 
>> 
>> 9. Start Server
>> 
>> 
>> * Note1: The paths might be adjusted according to the version of
>> openssl / apr / tomcat-native / tomcat version
>> 
>> 
>> Logs:
>> 
>> 01-Jun-2017 09:32:46.551 INFO [main] 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded
>> APR based Apache Tomcat Native library [1.2.12] using APR version
>> [1.5.2].
>> 
>> 01-Jun-2017 09:32:46.551 INFO [main] 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR 
>> capabilities: IPv6 [true], sendfile [true], accept filters [false],
>> random [true].
>> 
>> 01-Jun-2017 09:32:46.551 INFO [main] 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
>> APR/OpenSSL configuration: useAprConnector [false], useOpenSSL
>> [true]
>> 
>> 01-Jun-2017 09:32:46.556 INFO [main] 
>> org.apache.catalina.core.AprLifecycleListener.initializeSSL
>> OpenSSL successfully initialized [OpenSSL 1.0.2l  25 May 2017]
>> 
>> 
>> My question regarding this guide: Is there anything which might be
>> changed or is bad practice?
> 
> Everything looks good to me.
> 
> Whenever I try to build tcnative on my Mac, I find that XCode has
> broken some kind of symlink somewhere that I need to correct in order
> to use clang from the CLI. Some notes about how to work-around that
> would be good.

I was thinking of adding this line as optional. I tried to write a guide 
sometime ago but failed and switched to jetty. I am very happy that Tomcat with 
http/2 is running for me because I can test the Apache Wicket http/2 
experimental integration on 

Re: Developer quickstart guide for Tomcat with HTTP/2 on macOS

2017-06-01 Thread Tobias Soloschenko
Hi,

what do you think of adding this to wiki or a place to point to?

kind regards

Tobias

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



Developer quickstart guide for Tomcat with HTTP/2 on macOS

2017-06-01 Thread Tobias Soloschenko
Hi everyone,

a long time ago I tried out to install Apache Tomcat with HTTP/2 support on
macOS. I finally got a short time window to complete a developer quickstart
guide for that:

1. Download XCode from the AppStore


2. Install Brew: http://brew.sh/


3. Download Apache Tomcat binaries > 8.5 http://tomcat.apache.org/


4. Install APR and OPENSSL with “brew install openssl” and “brew install
apr”


5. Create pem files in “apache-tomcat-8.5.15/conf” folder - use “changeit”
every time a password is going to be requested (The commands can be
executed separately or within a shell script):

/usr/local/Cellar/openssl/1.0.2l/bin/openssl genrsa -des3 -out
localhost-rsa-key 1024

/usr/local/Cellar/openssl/1.0.2l/bin/openssl genrsa -out localhost-key 1024

/usr/local/Cellar/openssl/1.0.2l/bin/openssl rsa -in localhost-rsa-key -out
localhost-key

/usr/local/Cellar/openssl/1.0.2l/bin/openssl req -new -key localhost-key
-out localhost-csr

/usr/local/Cellar/openssl/1.0.2l/bin/openssl x509 -req -days 365 -in
localhost-csr -signkey localhost-key -out localhost-crt

cat localhost-key localhost-crt > localhost-rsa-cert.pem

cat localhost-rsa-cert.pem > localhost-rsa-chain.pem

cat localhost-rsa-key > localhost-rsa-key-mod.pem

/usr/local/Cellar/openssl/1.0.2l/bin/openssl rsa -in
localhost-rsa-key-mod.pem -out localhost-rsa-key.pem


6. Uncomment the http/2 connector with protocol
“org.apache.coyote.http11.Http11AprProtocol” in the
"apache-tomcat-8.5.15/conf/server.xml"


7. Tomcat native installation

Extract “apache-tomcat-8.5.15/bin/tomcat-native.tar.gz”

Go into folder “apache-tomcat-8.5.15/bin/tomcat-native-1.2.12-src/native”

Run “./configure --with-apr=/usr/local/Cellar/apr/1.5.2_3/
--with-ssl=/usr/local/Cellar/openssl/1.0.2l”

Run “make”


8. Create a setenv.sh file within the /bin folder and add lines:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Cellar/apr/1.5.2_3/libexec/lib:/Applications/apache-tomcat-8.5.15/bin/tomcat-native-1.2.12-src/native/.libs

JAVA_OPTS="-Djava.library.path=/usr/local/Cellar/apr/1.5.2_3/libexec/lib:/Applications/apache-tomcat-8.5.15/bin/tomcat-native-1.2.12-src/native/.libs"


9. Start Server


* Note1: The paths might be adjusted according to the version of openssl /
apr / tomcat-native / tomcat version


Logs:

01-Jun-2017 09:32:46.551 INFO [main]
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR
based Apache Tomcat Native library [1.2.12] using APR version [1.5.2].

01-Jun-2017 09:32:46.551 INFO [main]
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR
capabilities: IPv6 [true], sendfile [true], accept filters [false], random
[true].

01-Jun-2017 09:32:46.551 INFO [main]
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL
configuration: useAprConnector [false], useOpenSSL [true]

01-Jun-2017 09:32:46.556 INFO [main]
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL
successfully initialized [OpenSSL 1.0.2l  25 May 2017]


My question regarding this guide: Is there anything which might be changed
or is bad practice?


thanks in advance / kind regards

Tobias


Re: Access hidden fields array

2017-05-03 Thread Tobias Soloschenko
Hi,

thanks a lot for the clarification. I changed the implementation to access the 
parameter with brackets, now. Everything is working like expected.

kind regards

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



Re: Access hidden fields array

2017-05-03 Thread Tobias Soloschenko
Hi,

thanks for the detailed answer.

The reason why I used the brackets was that in some cases (browsers) only
the first value was returned. (Even if there were more then one hidden
field with that name)

Also mentioned here: http://stackoverflow.com/a/6547234 - PHP is also
resolving the variable without brackets.

There are various other questions at stackoverflow mentioning to get the
variable without brackets:

http://stackoverflow.com/questions/6547209/passing-array-using-html-form-hidden-element
http://stackoverflow.com/questions/4237090/how-to-pass-array-through-hidden-field
http://stackoverflow.com/questions/29076219/javascript-storing-array-of-objects-in-hidden-field

Don't know if this should be supported.

kind regards

Tobias

2017-05-03 12:05 GMT+02:00 André Warnier (tomcat) <a...@ice-sa.com>:

> On 03.05.2017 11:23, Tobias Soloschenko wrote:
>
>> Hello everyone,
>>
>> I just updated to tomcat 8.0.43 and I noticed a special behavior I want to
>> discuss. (I don't know if this only occurs with this version)
>>
>> When I add two hidden fields within a form like:
>>
>> 
>>
>> 
>>
>>
>> I just thought to access the parameter values within the java api like
>>
>> String[] myArray = httpServletRequest.getParameterValues("array");
>>
>>
>> In my case however I just can access them like (with brackets):
>>
>> String[] myArray = httpServletRequest.getParameterValues("array[]");
>>
>>
>> This also applies to httpServletRequest.getParameterMap().containsKey
>>
>>
>> Is this an expected behavior?
>>
>>
>>
> I would tend to say : yes, it is expected.
> (This also has nothing to do with tomcat per se, and is more of the domain
> of the HTML and HTTP specifications).
>
> I have not checked the relevant HTML/HTTP specs to verify which characters
> precisely are allowed in the "name" attribute of a HTML  field.
> But assuming that "[" and "]" /are/ allowed in such attributes, then that
> is the name under which the value of this parameter will be sent by the
> browser to the server.
>
> More precisely : if you have in your form an  element such as :
>
> 
>
> (whatever "xyz[123abc]" may be, in terms of valid characters)
> then "xyz[123abc]" is the name/label of this parameter, and the browser
> will send the corresponding input field value to the server as something
> like :
>
> xyz[123abc]=1
>
> The fact that this label /resembles/ the way in which you would invoke an
> array in Java (or any other server-side programming language) is pure
> coincidence.
>
> In other words again, in your above example, if you replaced "array[]" by
> "array][" (or "array)(", or "array(xyz)" or "variable#1") everywhere, it
> would work just the same. It's just a label.
>
> And the fact that in your example they are seen as an array on the java
> side, is just because there is more than one value sent by the browser with
> that same label, and the POST parsing logic on the server side then makes
> this into an array of values.
>
> This all being said, I would not name any input fields in a form with a
> name like "array[]". That is bound to create confusion, as you yourself can
> now attest.
> You can name is "ferrari" instead; but that does not mean that on the
> server side, you should expect something red with 4 wheels and 12 cylinders.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Access hidden fields array

2017-05-03 Thread Tobias Soloschenko
Hello everyone,

I just updated to tomcat 8.0.43 and I noticed a special behavior I want to
discuss. (I don't know if this only occurs with this version)

When I add two hidden fields within a form like:






I just thought to access the parameter values within the java api like

String[] myArray = httpServletRequest.getParameterValues("array");


In my case however I just can access them like (with brackets):

String[] myArray = httpServletRequest.getParameterValues("array[]");


This also applies to httpServletRequest.getParameterMap().containsKey


Is this an expected behavior?


kind regards and thanks in advance

Tobias


Re: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-05-12 Thread Tobias Soloschenko
Hi,

short update: I got HTTP/2 with Apache Wicket running on Jetty, now.

Sadly I couldn't solve the issues with Tomcat. :-(

kind regards

Tobias

> Am 05.04.2016 um 05:00 schrieb Christopher Schultz 
> <ch...@christopherschultz.net>:
> 
> Tobias,
> 
>> On 4/4/16 4:49 AM, Tobias Soloschenko wrote:
>> I just figured out that this issue might depend on the file names of APR
>> 1.5.2 - if I create links in the lib folder that reflects the names of
>> 1.4.8 - tomcat throws an exception that the version of APR can not be
>> resolved:
>> 
>> ln -s libapr-1.0.dylib libtcnative-1.0.dylib
>> 
>> ln -s libapr-1.a libtcnative-1.a
>> 
>> ln -s libapr-1.dylib libtcnative-1.dylib
>> 
>> ln -s libapr-1.la libtcnative-1.la
>> 
>> 
>> Exception:
>> 
>> 04-Apr-2016 10:42:39.579 WARNING [main]
>> org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
>> Tomcat Native library failed to load. The error reported was
>> [org.apache.tomcat.jni.Library.version(I)I]
> 
> That wasn't going to work.
> 
> APR and tcnative are different libraries. Copying one to the other is
> about as useful as trying to load your /etc/passwd file as a shared library.
> 
> When you set JAVA_OPTS:
> 
>> "export
>> JAVA_OPTS=-Djava.library.path=/usr/local/Cellar/apr/1.5.2/libexec/lib"
>> 
>> but Tomcat can not find it at this location.
> 
> How did you start Tomcat after that? What files are in
> .../1.5.2/libexec/lib? What is in your "TCNATIVE_PRIV_INCLUDES"
> directory? Where do you configure that for loading into Tomcat?
> 
> -chris
> 
> -
> 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: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-07 Thread Tobias Soloschenko
Any other hints?

kind regards

Tobias

> Am 05.04.2016 um 05:00 schrieb Christopher Schultz 
> <ch...@christopherschultz.net>:
> 
> Tobias,
> 
>> On 4/4/16 4:49 AM, Tobias Soloschenko wrote:
>> I just figured out that this issue might depend on the file names of APR
>> 1.5.2 - if I create links in the lib folder that reflects the names of
>> 1.4.8 - tomcat throws an exception that the version of APR can not be
>> resolved:
>> 
>> ln -s libapr-1.0.dylib libtcnative-1.0.dylib
>> 
>> ln -s libapr-1.a libtcnative-1.a
>> 
>> ln -s libapr-1.dylib libtcnative-1.dylib
>> 
>> ln -s libapr-1.la libtcnative-1.la
>> 
>> 
>> Exception:
>> 
>> 04-Apr-2016 10:42:39.579 WARNING [main]
>> org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
>> Tomcat Native library failed to load. The error reported was
>> [org.apache.tomcat.jni.Library.version(I)I]
> 
> That wasn't going to work.
> 
> APR and tcnative are different libraries. Copying one to the other is
> about as useful as trying to load your /etc/passwd file as a shared library.
> 
> When you set JAVA_OPTS:
> 
>> "export
>> JAVA_OPTS=-Djava.library.path=/usr/local/Cellar/apr/1.5.2/libexec/lib"
>> 
>> but Tomcat can not find it at this location.
> 
> How did you start Tomcat after that? What files are in
> .../1.5.2/libexec/lib? What is in your "TCNATIVE_PRIV_INCLUDES"
> directory? Where do you configure that for loading into Tomcat?
> 
> -chris
> 
> -
> 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: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-05 Thread Tobias Soloschenko
I missed to answer some of the other questions:

1. I start tomcat with the startup.sh
2. The files in the ../1.5.2/libexec/lib can be derived from the ln -s commands 
(see below)
3. TCNATIVE_PRIV_INCLUDES is default I didn't changed here anything.
4. I posted a step by step guide - I think if I run configure with the args 
"--prefix=" the native libraries are placed into the lib folder.

kind regards

Tobias

> Am 05.04.2016 um 05:00 schrieb Christopher Schultz 
> <ch...@christopherschultz.net>:
> 
> Tobias,
> 
>> On 4/4/16 4:49 AM, Tobias Soloschenko wrote:
>> I just figured out that this issue might depend on the file names of APR
>> 1.5.2 - if I create links in the lib folder that reflects the names of
>> 1.4.8 - tomcat throws an exception that the version of APR can not be
>> resolved:
>> 
>> ln -s libapr-1.0.dylib libtcnative-1.0.dylib
>> 
>> ln -s libapr-1.a libtcnative-1.a
>> 
>> ln -s libapr-1.dylib libtcnative-1.dylib
>> 
>> ln -s libapr-1.la libtcnative-1.la
>> 
>> 
>> Exception:
>> 
>> 04-Apr-2016 10:42:39.579 WARNING [main]
>> org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
>> Tomcat Native library failed to load. The error reported was
>> [org.apache.tomcat.jni.Library.version(I)I]
> 
> That wasn't going to work.
> 
> APR and tcnative are different libraries. Copying one to the other is
> about as useful as trying to load your /etc/passwd file as a shared library.
> 
> When you set JAVA_OPTS:
> 
>> "export
>> JAVA_OPTS=-Djava.library.path=/usr/local/Cellar/apr/1.5.2/libexec/lib"
>> 
>> but Tomcat can not find it at this location.
> 
> How did you start Tomcat after that? What files are in
> .../1.5.2/libexec/lib? What is in your "TCNATIVE_PRIV_INCLUDES"
> directory? Where do you configure that for loading into Tomcat?
> 
> -chris
> 
> -
> 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: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-05 Thread Tobias Soloschenko
Hi

> Am 05.04.2016 um 05:00 schrieb Christopher Schultz 
> <ch...@christopherschultz.net>:
> 
> Tobias,
> 
>> On 4/4/16 4:49 AM, Tobias Soloschenko wrote:
>> I just figured out that this issue might depend on the file names of APR
>> 1.5.2 - if I create links in the lib folder that reflects the names of
>> 1.4.8 - tomcat throws an exception that the version of APR can not be
>> resolved:
>> 
>> ln -s libapr-1.0.dylib libtcnative-1.0.dylib
>> 
>> ln -s libapr-1.a libtcnative-1.a
>> 
>> ln -s libapr-1.dylib libtcnative-1.dylib
>> 
>> ln -s libapr-1.la libtcnative-1.la
>> 
>> 
>> Exception:
>> 
>> 04-Apr-2016 10:42:39.579 WARNING [main]
>> org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
>> Tomcat Native library failed to load. The error reported was
>> [org.apache.tomcat.jni.Library.version(I)I]
> 
> That wasn't going to work.
> 
> APR and tcnative are different libraries. Copying one to the other is
> about as useful as trying to load your /etc/passwd file as a shared library.

I don't mix the libraries. I had a look into the apr version installed by 
default /usr/local/apr/lib (1.4.8) and the files in that directory are named 
that way - so I linked those of APR 1.5.8 the same - then tomcat greps them up 
and try to find the version which causes the exception.

> 
> When you set JAVA_OPTS:
> 
>> "export
>> JAVA_OPTS=-Djava.library.path=/usr/local/Cellar/apr/1.5.2/libexec/lib"
>> 
>> but Tomcat can not find it at this location.
> 
> How did you start Tomcat after that? What files are in
> .../1.5.2/libexec/lib? What is in your "TCNATIVE_PRIV_INCLUDES"
> directory? Where do you configure that for loading into Tomcat?
> 

As you can see in my first post (the log extract) tomcat uses the folder as 
expected, because when I switch to /usr/local/apr/lib it takes 1.4.8 - but this 
does not work for 1.5.2. 

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

kind regards

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



Re: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-04 Thread Tobias Soloschenko
Hi,

I just figured out that this issue might depend on the file names of APR
1.5.2 - if I create links in the lib folder that reflects the names of
1.4.8 - tomcat throws an exception that the version of APR can not be
resolved:

ln -s libapr-1.0.dylib libtcnative-1.0.dylib

ln -s libapr-1.a libtcnative-1.a

ln -s libapr-1.dylib libtcnative-1.dylib

ln -s libapr-1.la libtcnative-1.la


Exception:

04-Apr-2016 10:42:39.579 WARNING [main]
org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
Tomcat Native library failed to load. The error reported was
[org.apache.tomcat.jni.Library.version(I)I]

 java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Library.version(I)I

at org.apache.tomcat.jni.Library.version(Native Method)

at org.apache.tomcat.jni.Library.initialize(Library.java:181)

at
org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:198)

at
org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:107)

at org.apache.catalina.connector.Connector.setProtocol(Connector.java:587)

at org.apache.catalina.connector.Connector.(Connector.java:70)

at
org.apache.catalina.startup.ConnectorCreateRule.begin(ConnectorCreateRule.java:64)

at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1188)

at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)

at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1344)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)

at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)

at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)

at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)

at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)

at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)

at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1461)

at org.apache.catalina.startup.Catalina.load(Catalina.java:578)

at org.apache.catalina.startup.Catalina.load(Catalina.java:629)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)


kind regards

Tobias


2016-04-03 12:17 GMT+02:00 Mark Thomas <ma...@apache.org>:

> On 3 April 2016 04:29:40 BST, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> >Hi,
> >
> >I am trying to get http/2 working on Mac OS X 10.11.4 - these are the
> >steps I used:
> >
> >1. Install Brew: http://brew.sh/
> >
> >2. Download Apache Tomcat 9 https://tomcat.apache.org/download-90.cgi
> >
> >3. Download Xcode command line tools by opening the terminal and
> >execute “xcode-select  —install”
> >
> >4. Download Xcode from the AppStore
> >
> >5. Create a symlink for the xctoolchain:
> >
> >sudo ln -s
>
> >/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
> >/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain
> >
> >6. Install APR and OPENSSL with “brew install openssl” and “brew
> >install apr”
> >
> >7. Install tomcat native by extracting bin/tomcat-native.tar.gz and run
> >“./configure --with-ssl=/usr/local/Cellar/openssl/1.0.2g
> >--prefix=/Applications/apache-tomcat-9.0.0.M4
> >--with-apr=/usr/local/Cellar/apr/1.5.2 && make && make install” in
> >tomcat-native-1.2.5-src/native - see
> >
> >https://tomcat.apache.org/tomcat-9.0-doc/apr.html
>
>
> Do this one step at a time and check the results - particularly for
> configure. The start up messages suggest the wrong APR version was picked
> up and no OpenSSL version was found.
>
> Mark
>
>
> >8. export JAVA_OPTS=-Djava.library.path=/usr/local/apr/lib
> >
> >9. Create pem files in conf folder:
> >
> >/usr/local/Cellar/openssl/1.0.2g/

Re: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-04 Thread Tobias Soloschenko
One thing I made wrong was

"export JAVA_OPTS=-Djava.library.path=/usr/local/apr/lib" which is 1.4.8

the path to the new version installed with brew is

"export
JAVA_OPTS=-Djava.library.path=/usr/local/Cellar/apr/1.5.2/libexec/lib"

but Tomcat can not find it at this location.

I also tried to download APR 1.5.2 and install it by myself:

./configure.sh --prefix="/usr/local/apr_1.5.2"
make
make test
make install

but even if I use this folder in the library path Tomcat can't detect it:

"export JAVA_OPTS=-Djava.library.path=/usr/local/apr_1.5.2/lib"

Any idea what's the problem?

kind regards

Tobias



2016-04-03 12:17 GMT+02:00 Mark Thomas <ma...@apache.org>:

> On 3 April 2016 04:29:40 BST, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> >Hi,
> >
> >I am trying to get http/2 working on Mac OS X 10.11.4 - these are the
> >steps I used:
> >
> >1. Install Brew: http://brew.sh/
> >
> >2. Download Apache Tomcat 9 https://tomcat.apache.org/download-90.cgi
> >
> >3. Download Xcode command line tools by opening the terminal and
> >execute “xcode-select  —install”
> >
> >4. Download Xcode from the AppStore
> >
> >5. Create a symlink for the xctoolchain:
> >
> >sudo ln -s
>
> >/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
> >/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain
> >
> >6. Install APR and OPENSSL with “brew install openssl” and “brew
> >install apr”
> >
> >7. Install tomcat native by extracting bin/tomcat-native.tar.gz and run
> >“./configure --with-ssl=/usr/local/Cellar/openssl/1.0.2g
> >--prefix=/Applications/apache-tomcat-9.0.0.M4
> >--with-apr=/usr/local/Cellar/apr/1.5.2 && make && make install” in
> >tomcat-native-1.2.5-src/native - see
> >
> >https://tomcat.apache.org/tomcat-9.0-doc/apr.html
>
>
> Do this one step at a time and check the results - particularly for
> configure. The start up messages suggest the wrong APR version was picked
> up and no OpenSSL version was found.
>
> Mark
>
>
> >8. export JAVA_OPTS=-Djava.library.path=/usr/local/apr/lib
> >
> >9. Create pem files in conf folder:
> >
> >/usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -des3 -out
> >localhost-rsa-key 1024
> >
> >/usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -out localhost-key
> >1024
> >
> >/usr/local/Cellar/openssl/1.0.2g/bin/openssl rsa -in localhost-rsa-key
> >-out localhost-key
> >
> >/usr/local/Cellar/openssl/1.0.2g/bin/openssl req -new -key
> >localhost-key -out localhost-csr
> >
> >/usr/local/Cellar/openssl/1.0.2g/bin/openssl x509 -req -days 365 -in
> >localhost-csr -signkey localhost-key -out localhost-crt
> >
> >cat localhost-key localhost-crt > localhost-rsa-cert.pem
> >
> >cat localhost-rsa-cert.pem > localhost-rsa-chain.pem
> >
> >cat localhost-rsa-key > localhost-rsa-key.pem
> >
> >10. Uncomment the http/2 connector in the server.xml
> >
> >
> >
> >I am currently facing those issues (out of the log):
> >
> >
> >
> >02-Apr-2016 09:15:13.415 INFO [main]
> >org.apache.catalina.startup.VersionLoggerListener.log Command line
> >argument: -Djava.io.tmpdir=/Applications/apache-tomcat-9.0.0.M4/temp
> >
> >02-Apr-2016 09:15:13.415 INFO [main]
> >org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR
> >based Apache Tomcat Native library 1.2.5 using APR version 1.4.8.
> >
> >02-Apr-2016 09:15:13.415 INFO [main]
> >org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR
> >capabilities: IPv6 [true], sendfile [true], accept filters [false],
> >random [true].
> >
> >02-Apr-2016 09:15:13.418 SEVERE [main]
> >org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Failed to
> >initialize the SSLEngine.
> >
> >org.apache.tomcat.jni.Error: 70023: This function has not been
> >implemented on this platform
> >
> >at org.apache.tomcat.jni.SSL.initialize(Native Method)
> >
> >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> >at
>
> >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >
> >at
>
> >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >
> >at java.lang.reflect.Method.invoke(Method.java:497)
> >
> >at
>
> >org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLif

Re: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-03 Thread Tobias Soloschenko
I am going to contribute a step by step guide to the documentation (only for 
developers) when I got it working for me.

kind regards

Tobias

> Am 03.04.2016 um 22:09 schrieb Terence M. Bandoian <tere...@tmbsw.com>:
> 
>> On 4/2/2016 10:29 PM, Tobias Soloschenko wrote:
>> Hi,
>> 
>> I am trying to get http/2 working on Mac OS X 10.11.4 - these are the steps 
>> I used:
>> 
>> 1. Install Brew: http://brew.sh/
>> 
>> 2. Download Apache Tomcat 9 https://tomcat.apache.org/download-90.cgi
>> 
>> 3. Download Xcode command line tools by opening the terminal and execute 
>> “xcode-select  —install”
>> 
>> 4. Download Xcode from the AppStore
>> 
>> 5. Create a symlink for the xctoolchain:
>> 
>> sudo ln -s 
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
>>  /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain
>> 
>> 6. Install APR and OPENSSL with “brew install openssl” and “brew install apr”
>> 
>> 7. Install tomcat native by extracting bin/tomcat-native.tar.gz and run 
>> “./configure --with-ssl=/usr/local/Cellar/openssl/1.0.2g 
>> --prefix=/Applications/apache-tomcat-9.0.0.M4 
>> --with-apr=/usr/local/Cellar/apr/1.5.2 && make && make install” in 
>> tomcat-native-1.2.5-src/native - see
>> 
>> https://tomcat.apache.org/tomcat-9.0-doc/apr.html
>> 
>> 8. export JAVA_OPTS=-Djava.library.path=/usr/local/apr/lib
>> 
>> 9. Create pem files in conf folder:
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -des3 -out 
>> localhost-rsa-key 1024
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -out localhost-key 1024
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl rsa -in localhost-rsa-key -out 
>> localhost-key
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl req -new -key localhost-key 
>> -out localhost-csr
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl x509 -req -days 365 -in 
>> localhost-csr -signkey localhost-key -out localhost-crt
>> 
>> cat localhost-key localhost-crt > localhost-rsa-cert.pem
>> 
>> cat localhost-rsa-cert.pem > localhost-rsa-chain.pem
>> 
>> cat localhost-rsa-key > localhost-rsa-key.pem
>> 
>> 10. Uncomment the http/2 connector in the server.xml
> 
> 
> Is this procedure included in the Tomcat documentation?  Seems like it would 
> be useful if it isn't.
> 
> Thanks.
> 
> -Terence Bandoian
> http://www.tmbsw.com/
> 
> 
>> 
>> I am currently facing those issues (out of the log):
>> 
>> 
>> 
>> 02-Apr-2016 09:15:13.415 INFO [main] 
>> org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
>> -Djava.io.tmpdir=/Applications/apache-tomcat-9.0.0.M4/temp
>> 
>> 02-Apr-2016 09:15:13.415 INFO [main] 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR 
>> based Apache Tomcat Native library 1.2.5 using APR version 1.4.8.
>> 
>> 02-Apr-2016 09:15:13.415 INFO [main] 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR 
>> capabilities: IPv6 [true], sendfile [true], accept filters [false], random 
>> [true].
>> 
>> 02-Apr-2016 09:15:13.418 SEVERE [main] 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Failed to 
>> initialize the SSLEngine.
>> 
>>  org.apache.tomcat.jni.Error: 70023: This function has not been implemented 
>> on this platform
>> 
>> at org.apache.tomcat.jni.SSL.initialize(Native Method)
>> 
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 
>> at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> 
>> at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> 
>> at java.lang.reflect.Method.invoke(Method.java:497)
>> 
>> at 
>> org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:284)
>> 
>> at 
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:136)
>> 
>> at 
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
>> 
>> at 
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
>> 
>> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:104)
>> 
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
>> 
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
>

Re: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-03 Thread Tobias Soloschenko
Ok I run it again - here are the results:

./configure --with-ssl=/usr/local/Cellar/openssl/1.0.2g
--prefix=/Applications/apache-tomcat-9.0.0.M4
--with-apr=/usr/local/Cellar/apr/1.5.2 && make && make install

checking build system type... x86_64-apple-darwin15.4.0

checking host system type... x86_64-apple-darwin15.4.0

checking target system type... x86_64-apple-darwin15.4.0

checking for a BSD-compatible install... /usr/bin/install -c

checking for working mkdir -p... yes

Tomcat Native Version: 1.2.5

checking for chosen layout... tcnative

checking for APR... yes

configure: APR 1.5.2 detected.

  setting CC to "clang"

  setting CPP to "clang -E"

  adding
"-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/include"
to TCNATIVE_PRIV_INCLUDES

checking for JDK os include directory...  darwin

  adding
"-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/include/darwin"
to TCNATIVE_PRIV_INCLUDES

checking for gcc... clang

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether clang accepts -g... yes

checking for clang option to accept ISO C89... none needed

checking for OpenSSL library... using openssl from
/usr/local/Cellar/openssl/1.0.2g/lib and
/usr/local/Cellar/openssl/1.0.2g/include

checking OpenSSL library version >= 1.0.2... ok

checking for OpenSSL DSA support... yes

  adding "-I/usr/local/Cellar/openssl/1.0.2g/include" to
TCNATIVE_PRIV_INCLUDES

  setting TCNATIVE_LDFLAGS to "-L/usr/local/Cellar/openssl/1.0.2g/lib -lssl
-lcrypto"

  adding "-DHAVE_OPENSSL" to CFLAGS

  setting TCNATIVE_LIBS to ""

  setting TCNATIVE_LIBS to " /usr/local/Cellar/apr/1.5.2/libexec/lib/
libapr-1.la -lpthread"

checking for apr_pollset_wakeup in -lapr-1... yes

  adding "-DHAVE_POLLSET_WAKEUP" to CFLAGS

configure: creating ./config.status

config.status: creating tcnative.pc

config.status: creating Makefile

config.status: executing default commands

make[1]: Nothing to be done for `local-all'.

make[1]: Nothing to be done for `local-all'.

/usr/local/Cellar/apr/1.5.2/libexec/build-1/mkdir.sh
/Applications/apache-tomcat-9.0.0.M4/include/apr-1
/Applications/apache-tomcat-9.0.0.M4/lib/pkgconfig \

/Applications/apache-tomcat-9.0.0.M4/lib
/Applications/apache-tomcat-9.0.0.M4/bin

/usr/bin/install -c -m 644 tcnative.pc
/Applications/apache-tomcat-9.0.0.M4/lib/pkgconfig/tcnative-1.pc

list=''; for i in $list; do \

( cd $i ; /Applications/Xcode.app/Contents/Developer/usr/bin/make DESTDIR=
install ); \

done

/bin/sh /usr/local/Cellar/apr/1.5.2/libexec/build-1/libtool --mode=install
/usr/bin/install -c -m 755 libtcnative-1.la
/Applications/apache-tomcat-9.0.0.M4/lib

libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.0.dylib
/Applications/apache-tomcat-9.0.0.M4/lib/libtcnative-1.0.dylib

libtool: install: (cd /Applications/apache-tomcat-9.0.0.M4/lib && { ln -s
-f libtcnative-1.0.dylib libtcnative-1.dylib || { rm -f libtcnative-1.dylib
&& ln -s libtcnative-1.0.dylib libtcnative-1.dylib; }; })

libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.lai
/Applications/apache-tomcat-9.0.0.M4/lib/libtcnative-1.la

libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.a
/Applications/apache-tomcat-9.0.0.M4/lib/libtcnative-1.a

libtool: install: chmod 644
/Applications/apache-tomcat-9.0.0.M4/lib/libtcnative-1.a

libtool: install: ranlib
/Applications/apache-tomcat-9.0.0.M4/lib/libtcnative-1.a


In this step the right versions are used > APR 1.5.2 / OpenSSL 1.0.2g

Don't know why Tomcat detects APR 1.4.8 then.

Is there a setting where Tomcat try to resolve the APR path?


kind regards

Tobias

2016-04-03 12:17 GMT+02:00 Mark Thomas <ma...@apache.org>:

> On 3 April 2016 04:29:40 BST, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> >Hi,
> >
> >I am trying to get http/2 working on Mac OS X 10.11.4 - these are the
> >steps I used:
> >
> >1. Install Brew: http://brew.sh/
> >
> >2. Download Apache Tomcat 9 https://tomcat.apache.org/download-90.cgi
> >
> >3. Download Xcode command line tools by opening the terminal and
> >execute “xcode-select  —install”
> >
> >4. Download Xcode from the AppStore
> >
> >5. Create a symlink for the xctoolchain:
> >
> >sudo ln -s
>
> >/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
> >/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain
> >
> >6. Install APR and OPENSSL with “brew install openssl” and “brew
> >install apr”

Re: Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-03 Thread Tobias Soloschenko
Thanks - I am going to try it out.

kind regards

Tobias

> Am 03.04.2016 um 12:17 schrieb Mark Thomas <ma...@apache.org>:
> 
>> On 3 April 2016 04:29:40 BST, Tobias Soloschenko 
>> <tobiassolosche...@googlemail.com> wrote:
>> Hi,
>> 
>> I am trying to get http/2 working on Mac OS X 10.11.4 - these are the
>> steps I used:
>> 
>> 1. Install Brew: http://brew.sh/
>> 
>> 2. Download Apache Tomcat 9 https://tomcat.apache.org/download-90.cgi
>> 
>> 3. Download Xcode command line tools by opening the terminal and
>> execute “xcode-select  —install”
>> 
>> 4. Download Xcode from the AppStore
>> 
>> 5. Create a symlink for the xctoolchain:
>> 
>> sudo ln -s
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
>> /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain
>> 
>> 6. Install APR and OPENSSL with “brew install openssl” and “brew
>> install apr”
>> 
>> 7. Install tomcat native by extracting bin/tomcat-native.tar.gz and run
>> “./configure --with-ssl=/usr/local/Cellar/openssl/1.0.2g
>> --prefix=/Applications/apache-tomcat-9.0.0.M4
>> --with-apr=/usr/local/Cellar/apr/1.5.2 && make && make install” in
>> tomcat-native-1.2.5-src/native - see
>> 
>> https://tomcat.apache.org/tomcat-9.0-doc/apr.html
> 
> 
> Do this one step at a time and check the results - particularly for 
> configure. The start up messages suggest the wrong APR version was picked up 
> and no OpenSSL version was found.
> 
> Mark
> 
> 
>> 8. export JAVA_OPTS=-Djava.library.path=/usr/local/apr/lib
>> 
>> 9. Create pem files in conf folder:
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -des3 -out
>> localhost-rsa-key 1024
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -out localhost-key
>> 1024
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl rsa -in localhost-rsa-key
>> -out localhost-key
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl req -new -key
>> localhost-key -out localhost-csr
>> 
>> /usr/local/Cellar/openssl/1.0.2g/bin/openssl x509 -req -days 365 -in
>> localhost-csr -signkey localhost-key -out localhost-crt
>> 
>> cat localhost-key localhost-crt > localhost-rsa-cert.pem
>> 
>> cat localhost-rsa-cert.pem > localhost-rsa-chain.pem
>> 
>> cat localhost-rsa-key > localhost-rsa-key.pem
>> 
>> 10. Uncomment the http/2 connector in the server.xml
>> 
>> 
>> 
>> I am currently facing those issues (out of the log):
>> 
>> 
>> 
>> 02-Apr-2016 09:15:13.415 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Djava.io.tmpdir=/Applications/apache-tomcat-9.0.0.M4/temp
>> 
>> 02-Apr-2016 09:15:13.415 INFO [main]
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR
>> based Apache Tomcat Native library 1.2.5 using APR version 1.4.8.
>> 
>> 02-Apr-2016 09:15:13.415 INFO [main]
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR
>> capabilities: IPv6 [true], sendfile [true], accept filters [false],
>> random [true].
>> 
>> 02-Apr-2016 09:15:13.418 SEVERE [main]
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Failed to
>> initialize the SSLEngine.
>> 
>> org.apache.tomcat.jni.Error: 70023: This function has not been
>> implemented on this platform
>> 
>> at org.apache.tomcat.jni.SSL.initialize(Native Method)
>> 
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> 
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> 
>> at java.lang.reflect.Method.invoke(Method.java:497)
>> 
>> at
>> org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:284)
>> 
>> at
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:136)
>> 
>> at
>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
>> 
>> at
>> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
>> 
>> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:104)
>> 
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
>> 
>> at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
>> 
>

Apache Tomcat 9.0.0-M4 and http/2 on Mac OS X 10.11.4

2016-04-02 Thread Tobias Soloschenko
Hi,

I am trying to get http/2 working on Mac OS X 10.11.4 - these are the steps I 
used:

1. Install Brew: http://brew.sh/

2. Download Apache Tomcat 9 https://tomcat.apache.org/download-90.cgi

3. Download Xcode command line tools by opening the terminal and execute 
“xcode-select  —install”

4. Download Xcode from the AppStore

5. Create a symlink for the xctoolchain:

sudo ln -s 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain

6. Install APR and OPENSSL with “brew install openssl” and “brew install apr”

7. Install tomcat native by extracting bin/tomcat-native.tar.gz and run 
“./configure --with-ssl=/usr/local/Cellar/openssl/1.0.2g 
--prefix=/Applications/apache-tomcat-9.0.0.M4 
--with-apr=/usr/local/Cellar/apr/1.5.2 && make && make install” in 
tomcat-native-1.2.5-src/native - see

https://tomcat.apache.org/tomcat-9.0-doc/apr.html

8. export JAVA_OPTS=-Djava.library.path=/usr/local/apr/lib

9. Create pem files in conf folder:

/usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -des3 -out 
localhost-rsa-key 1024

/usr/local/Cellar/openssl/1.0.2g/bin/openssl genrsa -out localhost-key 1024

/usr/local/Cellar/openssl/1.0.2g/bin/openssl rsa -in localhost-rsa-key -out 
localhost-key

/usr/local/Cellar/openssl/1.0.2g/bin/openssl req -new -key localhost-key -out 
localhost-csr

/usr/local/Cellar/openssl/1.0.2g/bin/openssl x509 -req -days 365 -in 
localhost-csr -signkey localhost-key -out localhost-crt

cat localhost-key localhost-crt > localhost-rsa-cert.pem

cat localhost-rsa-cert.pem > localhost-rsa-chain.pem

cat localhost-rsa-key > localhost-rsa-key.pem

10. Uncomment the http/2 connector in the server.xml



I am currently facing those issues (out of the log):



02-Apr-2016 09:15:13.415 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.io.tmpdir=/Applications/apache-tomcat-9.0.0.M4/temp

02-Apr-2016 09:15:13.415 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based 
Apache Tomcat Native library 1.2.5 using APR version 1.4.8.

02-Apr-2016 09:15:13.415 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: 
IPv6 [true], sendfile [true], accept filters [false], random [true].

02-Apr-2016 09:15:13.418 SEVERE [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Failed to 
initialize the SSLEngine.

 org.apache.tomcat.jni.Error: 70023: This function has not been implemented on 
this platform

at org.apache.tomcat.jni.SSL.initialize(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at 
org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:284)

at 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:136)

at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)

at 
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)

at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:104)

at org.apache.catalina.startup.Catalina.load(Catalina.java:606)

at org.apache.catalina.startup.Catalina.load(Catalina.java:629)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)



02-Apr-2016 09:15:13.655 INFO [main] org.apache.coyote.AbstractProtocol.init 
Initializing ProtocolHandler ["http-nio-8080"]

02-Apr-2016 09:15:13.683 INFO [main] 
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared 
selector for servlet write/read

02-Apr-2016 09:15:13.686 INFO [main] 
org.apache.coyote.http11.AbstractHttp11Protocol.configureUpgradeProtocol The 
["https-apr-8443"] connector has been configured to support negotiation to [h2] 
via ALPN

02-Apr-2016 09:15:13.686 INFO [main] org.apache.coyote.AbstractProtocol.init 
Initializing ProtocolHandler ["https-apr-8443"]

02-Apr-2016 09:15:13.706 WARNING [main] 
org.apache.tomcat.util.net.openssl.OpenSSLEngine. Failed getting cipher 
list

 java.lang.Exception: Not implemented

at org.apache.tomcat.jni.SSL.newSSL(Native Method)

at 
org.apache.tomcat.util.net.openssl.OpenSSLEngine.(OpenSSLEngine.java:81)

at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:363)

at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:798)

at 

tomcat embedded / hcr within a maven environment

2015-12-09 Thread Tobias Soloschenko
Hello everyone,

is anyone able to give me a little hint about what I can do to
automatically deploy changes made in java files to an embedded tomcat? (hot
code replacement). Maybe it is a m2e related topic, but I just try to
figure out.

Currently I am starting a Runner class in test scope to publish a Wicket
Application which also uses CSS files generated with nodejs / npm / grunt:

https://github.com/klopfdreh/fluentsquare/blob/master/com.fluentsquare.web/src/test/java/com/fluentsquare/web/Runner.java

What actually works is that when the Runner has been started up and I
execute a "mvn package -Pwatch" and I change something in a sass file - it
is reflected back to the tomcat.

This does not work for java files. The context is not reloaded in that
case, even if I set the following options:

ctx.setReloadable(true);
ctx.setAntiResourceLocking(true);

kind regards and thanks in advance

Tobias