System.out.print doesn't work on JBoss EAP 6/JBoss AS 7 - jboss7.x

I deplyed a very simple war on JBoss EAP 6.0.1. The servlet action is ok,but System.out.print wasn't print to the console and server.log file.But System.out.println is working well,and when System.out.print and System.out.println both used,both work well.
I try the following setting,but still cann't make it work.Please help!
JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.logging.Log4jService.catchSystemOut=false"
JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.as.logging.per-deployment=false"
I try to add jboss-deployment-structure.xml to WEB-INF to use my own log4j,it doesn't work too.I also try to deploy the war on JBoss AS 7/JBoss EAP 6.1.0,get the same result.
It's a bug???

It doesn't really make sense that System.out.println would work, but System.out.print wouldn't. It should be printing to both the console and server.log assuming the default configuration.
The -Dorg.jboss.logging.Log4jService.catchSystemOut=false won't do anything since JBoss AS 7 doesn't use log4j. Also the -Dorg.jboss.as.logging.per-deployment=false only works on EAP 6.x, WildFly or builds off of the JBoss AS 7.1.3+ tags.

Related

Axis2 Fault : The system is attempting to engage a module that is not available: addressing

I have the addressing module in my modules folder as well. I have the <module ref="addressing"/> uncommented as well. But, it is still giving the error. I searched in another thread on Stack Overflow:
org.apache.axis2.AxisFault: The system is attempting to engage a module that is not available: addressing
But, it did not help.
Disclaimer- The axis2 war was working on JBoss Server but not on WAS server.
Solution- In axis2.xml file, there is a parameter 'EnableChildFirstClassLoading' which was commented, uncommenting it and deploying axis2 war again solved the issue.
Needed to make the above mentioned change on WAS server only.

Converting from JBoss AS7 to Wildfly

My project references the following Jar's and I am wondering whether these are the correct Jars for my version of WWildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final).
jboss-servlet-api_3.1_spec-1.0.0.Final.jar
jboss-ejb3-ext-api-2.2.0.Final.jar
jboss-ejb-api_3.2_spec-1.0.0.Final.jar
jboss-jsp-api_2.3_spec-1.0.1.Final.jar
Are these needed for Wildfly or are these the correct ones for WWildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)?
These version of jar will work with WildFly-10 release without any issue.

Spring Boot - Unable to override RabbitMQ properties

I've faced an issue with configuring RabbitMQ with Spring Boot.
I need to override host value for my application. I use JavaConfig approach. I use auto configuration feature as well.
So I put spring.rabbitmq.host=myhost.com property into application.properties but RabbitMQ ConnectionFactory still created with localhost value.
UPDATE1: Seems like my embedded Tomcat instance doesn't pick up updates in property files. I've added some custom property and Spring can't resolve the placeholder for it.
I run my application in IntellijIdea 14 as a common java app.
All class changes are picked up by IntellijIdea&Tomcat but all resources folder content is not.
Is this IntellijIdea 14 related issue?
Thanks in advance.
If you do that from test-case, be sure to use:
#ContextConfiguration(initializers = ConfigFileApplicationContextInitializer.class)
For the test class.
I think the name of the initializer should say for itself.
Issue was resolved. There was issue with IntellijIdea 14 & 13 Gradle project setup/files compatibility. So Re-Import of the project is a solution.

weblogic hot deployment working for jsps but not for web-inf/classes

I am deploying an ear application in weblogic 10.3 in exploded format with fast swap enabled and in dev mode.
The ear file contains a web app also in exploded format. The changes made to the jsps in the web app are getting reloaded. But the classes under web-inf when changed are not reloaded.
The weblogic deployment configuration is given below.
weblogic-application.xml content in ear/META-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:classloader-structure>
<wls:classloader-structure>
<wls:module-ref>
<wls:module-uri>web.war</wls:module-uri>
</wls:module-ref>
</wls:classloader-structure>
</wls:classloader-structure>
application.xml content in ear/META-INF
<display-name>web-ear</display-name>
<module>
<web>
<web-uri>web.war</web-uri>
<context-root>/web</context-root>
</web>
</module>
<library-directory>lib</library-directory>
weblogic.xml content in war/WEB-INF
<wls:fast-swap>
<wls:enabled>true</wls:enabled>
<wls:refresh-interval>10</wls:refresh-interval>
</wls:fast-swap>
<wls:context-root>/web</wls:context-root>
<wls:session-descriptor>
<wls:cookie-max-age-secs>-1</wls:cookie-max-age-secs>
<wls:cookie-name>JSESSIONID_SQE_AAI</wls:cookie-name>
<wls:cookie-path>/</wls:cookie-path>
<wls:cookies-enabled>true</wls:cookies-enabled>
<wls:invalidation-interval-secs>120</wls:invalidation-interval-secs>
<wls:id-length>52</wls:id-length>
<wls:timeout-secs>7200</wls:timeout-secs>
<wls:url-rewriting-enabled>true</wls:url-rewriting-enabled>
<wls:persistent-store-type>memory</wls:persistent-store-type>
<wls:http-proxy-caching-of-cookies>false</wls:http-proxy-caching-of-cookies>
</wls:session-descriptor>
<wls:jsp-descriptor>
<wls:page-check-seconds>6</wls:page-check-seconds>
</wls:jsp-descriptor>
<wls:container-descriptor>
<wls:servlet-reload-check-secs>6</wls:servlet-reload-check-secs>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
Is the configuration done above right? Are there any config details I have missed to include here? What other settings or configurations should I check?
Any help would be very much appreciated thanks.
Even if you enable FastSwap in your application, the modules that are declared in the classloader-structure will not support FastSwap because they aren't loaded by the RedefiningClassLoader, but rather by the GenericClassLoader.
You can test this by printing the classloader of your classes under WEB-INF/classes and check if it's the com.bea.wls.redef.RedefiningClassLoader or not.
I struggled to make them work together, you can see more details here https://forums.oracle.com/forums/thread.jspa?threadID=2476484&tstart=60 but, unfortunately, no solution so far.
Regards.

weblogic tapestry issues

My application using tapestry 4.1.6 jar files deploys correctly in weblogic 10.3.3.0. But at runtime, I am getting NoSuchMethodException from tapestry files.Same application works fine in weblogic 9. Any ideas?
Error Log
java.lang.NoSuchMethodError: org.apache.commons.pool.impl.TapestryKeyedObjectPool.assertOpen()V
at org.apache.commons.pool.impl.TapestryKeyedObjectPool.borrowObject(TapestryKeyedObjectPool.java:941)
at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:176)
at $IPageSource_12bf9e5c33a.getPage($IPageSource_12bf9e5c33a.java)
at org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:241)
at org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:228)
at org.apache.tapestry.engine.DirectService.service(DirectService.java:107)
at $IEngineService_12bf9e5c3ad.service($IEngineService_12bf9e5c3ad.java)
at org.apache.tapestry.services.impl.EngineServiceInnerProxy.service(EngineServiceInnerProxy.java:77)
at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:241)
at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
at $WebRequestServicer_12bf9e5c384.service($WebRequestServicer_12bf9e5c384.java)
at $WebRequestServicer_12bf9e5c380.service($WebRequestServicer_12bf9e5c380.java)
at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
at $ServletRequestServicer_12bf9e5c366.service($ServletRequestServicer_12bf9e5c366.java)
at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
at $ServletRequestServicerFilter_12bf9e5c362.service($ServletRequestServicerFilter_12bf9e5c362.java)
at $ServletRequestServicer_12bf9e5c368.service($ServletRequestServicer_12bf9e5c368.java)
at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
at $ServletRequestServicerFilter_12bf9e5c360.service($ServletRequestServicerFilter_12bf9e5c360.java)
at $ServletRequestServicer_12bf9e5c368.service($ServletRequestServicer_12bf9e5c368.java)
at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
I'd check to see if WebLogic 10.3 has a conflicting Tapestry JAR at the server class loader level. If yes, you'll want to tell WebLogic to prefer the version of Tapestry that it finds using your application class loader.
See <prefer-web-inf-classes> in weblogic.xml:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/classloading.html
Note: Weblogic is often configured by default, it filters javax.* package. (X Add J2EE libraries to buildpath)