migration from http to https in wildfly - java

I want to migrate from http to https in wildfly 19.1
after setup all configuration from this tutorials https://medium.com/#hasnat.saeed/setup-ssl-https-on-jboss-wildfly-application-server-fde6288a0f40 i have trouble :
when my application server startsup try to load all of pages.
note: my project is a huge project with heavy queries and this action take a lot of time

I found the solution. In the Standalone.xml we should disable the enable-http2="true" of this line:
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="false"\>

Related

cannot get STOMP acceptor running in Wildfly Swarm

I'm trying to set up a STOMP acceptor in my Wildfly 11 based Swarm deployment (using Swarm 2017.12.1 to generate a fat WAR, running via java -jar...), for letting clients send me progress messages, but could not get the acceptor to load, always get this error at server startup:
AMQ222203: Classpath lacks a protocol-manager for protocol STOMP, Protocol being ignored on acceptor TransportConfiguration(name=stomp-acceptor, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyAcceptorFactory) ?port=61613&protocols=STOMP
I am using an existing (but adapted) standalone-full.xml configuration to make the switch easier, and everything works fine so far (Java EE wise), but not the STOMP part (JMS works, though).
I've included some dependencies in the WAR's POM to fix previous class loading errors, but now I run out of ideas:
<dependency>
<groupid>org.apache.activemq</groupid>
<artifactid>activemq-rar</artifactid>
<version>5.15.2</version>
<type>rar</type>
</dependency>
<dependency>
<groupid>org.apache.activemq</groupid>
<artifactid>activemq-stomp</artifactid>
<version>5.15.2</version>
</dependency>
<dependency>
<groupid>io.netty</groupid>
<artifactid>netty-all</artifactid>
<version>4.1.5.Final</version>
</dependency>
(so I'm relying on Swarm to figure out needed fragments, which works for the rest)
My configuration for the messaging part looks like this:
<acceptor name="stomp-acceptor" factory-class="org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory">
<param name="protocols" value="STOMP"/>
<!--param name="connection-ttl" value="30000"/-->
<param name="host" value="${jboss.bind.address:127.0.0.1}"/>
<param name="port" value="61613"/>
<!--param name="stomp-enable-message-id" value="true"/-->
</acceptor>
I've searched Swarm, Artemis and also SO but didn't find a working solution.
Could it be that Wildfly 11 will not work since it's using Artemis 1.5 and Swarm does not yet fully support it?
some resources I found useful so far:
Wildfly-Swarm and connection to external activemq via resource adapter: WFLYCTL0412
Wildfly 11 connection to remote Artemis ActiveMQ server configuration
https://blog.dekstroza.io/wildfly-swarm-to-remote-wildfly-swarm-activemq-broker/
Receiving MQTT message with Wildlfy 11 embedded Apache Artemis
http://docs.wildfly-swarm.io/2017.12.1/#_messaging
http://docs.wildfly-swarm.io/2017.12.1/#_sockets
A friendly and helpful chat on #wildfly-swarm brought an explanation and possible solution, but we'll have to wait for the bugfix, see https://issues.jboss.org/browse/SWARM-1763
Ken Finnigan found out the root cause in an error in the modules configuration for messaging in Wildfly:
The issue is a result of the org.apache.activemq.artemis module.xml defining protocol modules for STOMP, AMQP and HornetQ as optional, so WF Swarm does not pick them up.

Websocket issue on wildfly cluster

I am using richfaces a4j:push in my Spring-JSF integrated application. I am able to push messages to the browser using websocket in my non cluster environment on wildfly 8.0.0.
When I deploy the application on wildfly8.0.0 on redhat enterprise 7.0 with httpd clustering the push messages are not working.
I get the following error on cluster environment:
17:15:22,862 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /star/__richfaces_push: java.lang.IllegalStateException: UT000077: The underlying transport does not support HTTP upgrade.
My cluster is configured with mod_cluster, referring the document
When I look for details on error UT000077, it says ‘Apache httpd doesn't support HTTP upgrade out of box’ I understand HTTP upgrade is required for websocket communication. It is suggested to use mod_proxy_wstunnel. However the details are not available for this configuration.
Any pointers/suggestions are much appreciated.
At the time of this answer AJP [which is the default one] does not support HTTP upgrade and hence not websocket.
If you switch to HTTP websocket will work.
Following changes you need to do to switch to AJP
Change
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
To
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
[comment out proxy_ajp_module and added proxy_http_module]
In modcluster sub-system
Change
<subsystem xmlns="urn:jboss:domain:modcluster:1.2">
<mod-cluster-config advertise-socket="modcluster" connector="ajp">
<dynamic-load-provider>
<load-metric type="cpu"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
To
<subsystem xmlns="urn:jboss:domain:modcluster:1.2">
<mod-cluster-config advertise-socket="modcluster" connector="default">
<dynamic-load-provider>
<load-metric type="cpu"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
[“default” is the name of the http listener]
Also you need to load mod_proxy_wstunnel in your httpd
MODCLUSTER-438 WebSocket support for mod_cluster
Let me give my two cents in this question to people there are using Apache 2.2.x If are you using Apache 2.2.x you need to compile the mod_proxy_wstunnel from Apache 2.4 for Apache 2.2.x This link have a how to do it. Following, to achieve WebSockets with mod_cluster you need also compile mod_cluster 1.3.3+ as described in this link and add EnableWsTunnel in your mod_cluster.conf outside your virtual host
I hope helps.

Internal server error axis2 Tomcat service wsdl

I'm getting an Internal server error when try to see the wsdl from a service that I deployed in axis2.
Only the sample service of axis works "Version?wsdl".
Funny thing is that I'm able to see the xsd from my service, i.e "service?xsd", but not the wsdl.
Any ideas?
I'm using axis2-1.5.6 and Tomcat 7.0.
If you are using https, you have to add following to your axis2.xml file
<transportReceiver name="https"
class="org.apache.axis2.transport.http.AxisServletListener">
<parameter name="port">8443</parameter>
</transportReceiver>
(full article)
This enables https listeren for axis2. It is not enabled by default (unlike http access) .
the axis2.xml file can be found here:
$CATALINA_HOME/webapps/axis2/WEB-INF/conf/axis2.xml

SSO Logout on JBoss 7.1.1 is not working for all webapps

I have different webapps on a JBoss 7.1.1. All of them are configured to use the same security-domain and the whole JBoss is configured to use SSO.
Login works like expected. If I login to Webapp 1 and switch to Webapp 2 the SSO is working. But If I do a logout in Webapp 1 (request.logout()) I am still logged in in Webapp 2. Is there any way to do a logout on every webapp which is bound to the SSO? I have not found anythink in the documentation.
Here is my current configuration:
standalone.xml
<virtual-server name="default-host" enable-welcome-root="false">
...
<sso reauthenticate="false"/>
</virtual-server>
jboss-web.xml (similar in all webapps)
<security-domain flushOnSessionInvalidation="true">java:/jaas/myDomain</security-domain>
<valve>
<class-name>org.apache.catalina.authenticator.SingleSignOn</class-name>
</valve>
If anyone knows a solution, it would be a huge help for me!
Thanks
It is a bug of jboss 7.1.1. (Workaround present.)
https://issues.jboss.org/browse/AS7-5728

Two different languages PHP and Java on same application with PHP on Apache and Java on Tomcat

I am also finding tough to categorize this question. So please bear with me to explain the issue.
We have two different applications:
PHP on XAMPP and
Java on Tomcat
Now we have a business case to merge both the products. ie., PHP product should be looking no different from the Java application and also it should be part of Java app. (appears in the one of the tab in Java app)
The CSS part can be taken care. But the complex part is how to collate these two application?
Also we are using Tomcat for Java and Apache for PHP,
in such case how do we bundle the product as one.
I tried googling, but most of them point to having apache and tomcat connector etc.
But I am still not clear on how to achieve this seamless integration.
Misc Info:
--- Java App: DB: MySQL, Maven, Servlet, Spring, Struts, Hibernate
--- PHP App: XAMPP (or somecases LAMP)
Please let me know if I had missed out any details.
The two applications served via apache should not be a problem look at mod_jk This will mean your java web app is still running on tomcat which it has to do anyway.
Maybe this tutorial will help. Though I haven't tried it myself so I can't say for sure.
I am able to get Apache talk to Tomcat through mod_proxy.
I actually referred to the below links to get this working (mostly changes to httpd.conf in Apache and server.xml in Tomcat):
http://tomcat.apache.org/tomcat-5.5-doc/proxy-howto.html
http://confluence.atlassian.com/display/DOC/Using+Apache+with+mod_proxy
http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearquest.webadmin.doc/rwp/t_config_mod_proxy_support.htm
I then configured PHP with Apache following [this link][1] and got the PHP configured with Apache.
So as a test program, I am able to reach servlet programs (Tomcat) from a Apache like http://localhost/example/servlet then access PHP programs too with a URL like http://localhost/phptest
ZeissS, Paul and Vincent. Thanks all for your help. Even though I have a long way to go, this looks like the starting point.
=== httpd.conf in Apache server ===
# enable the below or add new
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# Start Modules for PHP
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "c:/windows"
# Just at the end of 'Main' server configuration - add the below
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /examples http://localhost:8080/examples/
ProxyPass /servlets http://localhost:8080/examples/servlets/
ProxyPass /jsp http://localhost:8080/examples/jsp/
ProxyPassReverse /examples http://localhost:8080/examples/
# Finish Modules for PHP
=== server.xml in Tomcat ===
<!-- searched the below connector port=8080 and I replaced that tag with the below -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
proxyName="http://localhost" proxyPort="80"/>

Categories