Jhipster project in company's App server - jndi datasource - jhipster

I am quite new to Jhipster. I would appreciate some one can tell me, how can I access jndi Datasource, defined in Application server. Where in spring boot, i need to put it.
Appreciate your help.

If you deploy your Spring Boot application to an Application Server, you might want to configure and manage your DataSource by using your Application Server’s built-in features and access it by using JNDI.
The spring.datasource.jndi-name property can be used as an alternative to the spring.datasource.url, spring.datasource.username, and spring.datasource.password properties to access the DataSource from a specific JNDI location. For example, the following section in application.properties shows how you can access a JBoss AS defined DataSource:
spring.datasource.jndi-name=java:jboss/datasources/customers
in your case need to change the application.yml
spring:
datasource:
jndi-name: "java:/your/datasource"
and remove url.
FOR MORE INFO
spring boot doc

Related

Configure WebLogic application/Web Application to not use MOXy for JAXB

My company has a Web Application that uses the JAXB provider in the JDK
The application runs great in Tomcat.
We have a customer that want to to use WebLogic
The application fails when trying to create a JAXBContext.
This page https://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#WSGET347
documents how to configure a WebLogic application to not use MOXy for JAXB
When I use the "Global" solution, modifying the startup script to prepend modules/databinding.override.jar to the classpath, my Web App works fine
This is a rather large hammer as the customer has existing apps on an existing server and we are targeting that server.
When I try the Application level solution, no luck.
Any pointers as to where I going wrong?
Eclipse Workbench

Server created using hazelcast-3.6.jar is not picking up configs from hazelcast.xml

I am using spring boot to test my Rest API's with hazelcast-3.6 as the DB.I am using hazelcast-3.6.jar to setup a server.The server created this way is not picking up properties from hazelcast.xml provided.Can someone guide me how to make it pick up the properties from hazelcast.xml?
Run you program with -Dhazelcast.config=<path to hazelcast.xml> or put your hazelcast.xml in the classpath.
Make sure to put the hazelcast.xml to the right directory.
Please check the Checking configuration manual section where it's explained what's the order of config file check:
http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#checking-configuration
Please find the examples of using Hazelcast with Spring Boot here.
Here you can find how to configure Hazelcast with Spring.

How to deploy a .war to Embedded Jetty of Gridgain

I would like to deploy my custom web application (.war) to the embedded Jetty container of Gridgain. Would you please direct me to documentation or describe steps?
Please advise.
Thanks.
GridGain embedded Jetty server was not intended to run user war applications, so there is no explicit logic for war file deployment.
However, according to this question, you might be able to deploy a war file by specifying $JETTY_HOME environment variable and dropping your war file to appropriate folder.

jboss7 + same log4j configuration for different apps

I want to deploy some different applications using one jboss (jboss as 7). Can anyone make it clear for me if its possible to set one log4j configuration (log4j.xml) for multiple wars and ears or i'll have to put a copy of configuration into each archive?
Or maybe someone can suggest a differeng logging engine, more native to jboss7?
log4j configuration is always global to runtime. ie. A JBoss instance can't have multiple log4j configuration. log4j can be initialized or reinitialized with a single config file. it can be a simple properties file or a XML incompliance with log4j.dtd packaged with log4j*.jar. start the jboss instance with -Dlog4j.configuration=/anypath/log4jconfig.xml
I do not believe there is a way to configure log4j globally. JBoss AS7 uses JBoss Logging for it's log provider. You can configure the logging subsystem is in the standalone.xml or the domain.xml depending on if you're running in standalone or domain mode.
The documentation is not greatest unfortunately, but if you install the jboss-as-logging_1_1.xsd in your IDE you can get auto-complete. All the schemas are located in the docs/schema under the installed directory.

Override jsf implentation in WAS

I want to develop richface implented app on Ibm Websphere. I include *.jars under
WEB-INF/libs and it runs succesfull. But first deployment proccess is realy terriable..
So I want to add libraries to server, not include in application.
(i belevie it could increase 1st deployment).. Is there a way to override server impelemented
JSf in server side?
Thanks
You need to set the webapp's classloading policy to module instead of application in the Websphere deploy manager.

Resources