How to configure JBoss 5.1.0.GA to use Log4j2.16.0? - log4j2

I want to upgrade log4j in Jboss 5.1.0 GA to log4j 2.16.0 .
I want to know which jar file i have to replace and what changes is need to be done in log4j.xml file at location /JBOSS_HOME/server/default/conf .
Kindly also let me know if i need to do any other changes .

Related

Has anyone had success with Grails 4 / Java 11 and using DCEVM for hotswapping during development?

We upgraded to Grails 4 / Java 11 and lost hot-swapping capabilities during development. I tried DCEVM but the application wouldn't start (errors on first withNewSession call).
Has anyone had success with getting Grails and DCEVM to work together?
I've got hotswap working with Grails 5.1.2 but the Hibernate plugin causes a
org.hibernate.HibernateException: No Session found for current thread
so I had to disable the plugin. This means any changes to domain classes will still need a restart.
You'll need a copy of groovyReset.jar to avoid random errors due to Groovy caching methods that have been replaced by hotswap.
sdk install java 11.0.9-trava
sdk use java 11.0.9-trava
Add a copy of groovyReset.jar to your project root
Add the following to the bootRun jvmArgs in build.gradle:
'-XX:HotswapAgent=fatjar',
'-javaagent:groovyReset.jar'
Create src/main/resources/hotswap-agent.properties containing:
disabledPlugins=Hibernate
autoHotswap=true
You should now be able to start Grails and any code changes will be picked up without restarting.
Recently I tried with Hybris2005 + Java 11 + Windows + Eclipse.
Follow below given steps and do modification as per your need.
DCEVM 11 Configuration Step.
Download and extract java11-openjdk-dcevm-windows.zip in your local machine
Set JAVA_HOME=D:\java11-openjdk\dcevm-11.0.10+3 (Adjust the path as per location in your system)
In eclipse go to windows->Preference->Installed JRE and set JRE home to D:\java11-openjdk\dcevm-11.0.10+3
4 In local.properties adjust the property tomcat.debugjavaoptions as below
tomcat.debugjavaoptions=-XX:HotswapAgent=core -javaagent:D:/java11-openjdk/dcevm-11.0.10+3/lib/hotswap/hotswap-agent.jar=disablePlugin=Log4j2,disablePlugin=Spring,disablePlugin=Proxy,disablePlugin=AnonymousClassPatch,disablePlugin=ZK,autoHotswap=true -Djava.locale.providers=COMPAT,CLDR -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n -Xmx4G -Xms2G
Also, please set ANT_HOME environemnt variable so that we don't to run setantenv.bat from \hybris\bin\platform and update the PATH variable accordingly.
Perform ant clean all and start hybris in debug mode.
Add System.out.println() statement in your code and then execute ant build command from that specific extension folder.
Verify if HOT swap is done.

Grails - Message bundles (i18n) broken for war build only

After upgrading from 2.5.5 to 3.1.1, when I build my application as an executable war (or deploy to tomcat container), messages cannot be resolved from message.properties or any i18n properties files.
org.springframework.context.NoSuchMessageException: No message found under code 'timeZoneId' for locale 'en_US'.
When run in IntelliJ, it all works fine.
In terms of configuration, I’ve tried to make my build as close to the “out of box” Grails app as possible.
I’m wondering if anyone could provide a hint or suggestion as an avenue of investigation I could travel down as I’m just about out of ideas. Happy to add configuration detail as requested.
I'm using a multi-module build with a plugin as a dependency.
I suspect that maybe you have done some modification on your Grails project (2.5.5) that cant be support on the newest grails 3.3.0.
I would suggest you to check 3.3.0 documentation on how to customise your msg.
You can refer to https://docs.grails.org/latest/guide/validation.html. There is an example of how to modify your own label or msg.
In the case of the blank constraint this would be user.login.blank so you would need a message such as the following in your grails-app/i18n/messages.properties file:
user.login.blank=Your login name must be specified!
Hope it helps. Cheers

Grails Wrapper: run/re-run before or after change version?

I tried looking for the answer for this here but couldn't find it. If this is documented somewhere, please send the link as a comment and I'll delete the question.
I can't figure out the proper order for using Grails Wrapper when upgrading an app version:
Do I run grails wrapper and then change application.properties to the new version of Grails, and then execute all future commands using grailsw?; or
Do I change application.properties to the new version, then run grails wrapper, and then run all future commands with grailsw?
Running grails wrapper will download the version of the wrapper specified in application.properties, so you should run it after changing the version.

how to find your project current versions in grails

I want to know the versions of the software used while developing the project, Suppose If there is an existing project In grails ,so I want to know the version of grails as well as version of Groovy for that project
Metadata regarding a project in Grails is kept in application.properties.
Within this file you will find the version of Grails used for the project under the key app.grails.version.
The version of Groovy used however is not kept in this file and is determined by the version of Grails being used. To determine the version of Groovy used by a specific version of Grails visit the introduction section of the Grails documentation.
edit
As pointed out in another answer, if you have target version of Grails already downloaded you can search for the version of Groovy being used by that version of Grails.
*nix
$ cd grails-X.X.X
$ find . -name "groovy*jar"
win32
> cd grails-x.x.x
> dir /s "groovy*.jar"
From controllers/services:
def appVersion=Metadata.current.'app.grails.version'
def appName=Metadata.current.'app.name'
From gsp:
App Version <g:meta name="app.version"/>
Built with Grails <g:meta name="app.grails.version"/>
Added extra information to figure out a grails application version from raw text files :
If you have a grails 3 application, you should find a build.gradle in the main root of your application folder:
version "0.1" According to this grails 3 project the version of this application is 0.1
Grails version is 3.1.1 according to gradle.properties
On a grails 2 project you will find application.properties in the main project root:
According to this grails 2 project
grails version is 2.4.4
App version is 0.1
If you already have a project and want to learn which grails version it uses. You can find it in gradle.properties file.
The content of the file is like the following
grailsVersion=4.0.1
gorm.version=7.0.2.RELEASE
As of Grails 3, this is:
Version <g:meta name="info.app.version"/>
Notice the info.
http://docs.grails.org/3.0.17/ref/Tags/meta.html
use application.properties in the root of the grails application
To find out which version of groovy is used with particular version of grails I always use simple find:
$ cd grails-X.X.X
$ find . -name "groovy*jar"
Maybe I'm just too lazy to dig into websites... ;-)
You can see application name,grails version,application version from application.properties file of grails project
I face the same issue, I found simplest way to find version by simple command.
run
grails clean
then it prints
Welcome to Grails 1.3.7 - http://grails.org/

EJB calls from grails to glassfish

I need to use EJB remote calls from my grails application. For this in previouse Servlet application I used client glassfish jar(gf-client.jar) and is's worked.
How I can include gf-client.jar into build path in grails app for call EJB methodth?
thank you.
the answer was to copy all libraries of GlassFish application server to client mashine (directory with gf-client.jar and 2 levels up, check dependencies in gf-client.jar) and add only gf-client.jar to classpath of application. Ather dependencies will loaded automatically, when gf-client will loaded.
note 1: in my case for grails application witch I deploying to tomcat servlet container write full path to gf-client.jar to shared.loader section of catalina.properties file in conf dir, and restart tomcat.
note 2: for GlassFish v3.1 and up, replace gf-client.jar with gf-client-module.jar
Put gf-client.jar into the lib directory of your grails app. Any jar files in the lib directory of your grails app will automatically be included when you run your application as well as be packaged in generated war files.

Resources