Where to put Coherence configuration files? - oracle-coherence

I found lots of document talking about Oracle Coherence cluster configuration bur did't know where to put it, default configuration files location in coherence.jar but I don't think these files meant to be modified, I am using coherence with Weblogic 12c

I found the answer it should be put on the class path of the application, files with postfix override like tangosol-coherence-override.xml should override default configuration in coherence.jar

Related

Can a flyway config file include other config files?

I'm using the flyway command line tool. I'd like to setup different configuration settings for different environments (development/testing/production), but there will be some common settings. Ideally there can be a common.properties config, along with individual environment-specific configs (e.g. production.properties)
Does flyway support including properties from multiple config files in some way?
Yes, you can by exploiting the loading order of Flyway config files (http://flywaydb.org/documentation/commandline/#configFile)
Place the common settings in either
Flyway Install Dir/conf/flyway.conf
User Home Dir/flyway.conf
Current Dir/flyway.conf
You can then put the environment-specific properties in the file you specify with
-configFile=/path/to/envspecific.conf

Change Migration Configuration Location

Is there a way of changing the location of the Migrations/Configuration.cs file to another location without breaking EntityFramework migrations?
Of course, migration functionality is not dependent on where the Configuration.cs file is. You may freely move it. When you call migration scripts it will still search for Configuration class in whole project. Remember only about properly setting MigrationsDirectory property within Configuration class - it points to folder where you have your migration classes defined.

Log4j in Websphere

I recently take over a web application project using websphere and log4j running under AIX. To create a development environment, I setup all the components in windows, using eclipse to compile a WAR file and deploy it.
All is working fine except that log file is not created.
I changed the log file in log4j.properties from something like in below and and give everyone full access permission to the directory:
log4j.appender.F1.File=/abc/def/logs/admin.log
to
log4j.appender.F1.File=c:/logs/admin.log
What else can I check?
I create a simple standalone testapp which use the same log4j.properties and it can create the log file, but when the servlet deployed to websphere, it doesn't work. Please help! Thanks!
Ok, I think this article should help you. It seems that WebSphere CE uses log4j by default and controls it with a global properties file. There is a section on how to use application-specific properties files.
Here is what I try and do to troubleshoot similar issues.
Turn on log4j debugging to see where it actually picks up the file from. You need evidence of which file is picked up (so turning the debug on is a worthwhile activity) This provides you information with what log4j is trying to do to locate the configuration file.
-Dlog4j.debug=true
I would not hardcode the log4j location in the code. Instead I
would use the log4j.configuration System property and state that in
the JVM arguments. This way even I don't need to touch my code.
-Dlog4j.configuration=file:///home/manglu/log4j.properties
I would use this approach irrespective of the runtime server that I use (be it Tomcat or WAS CE or WAS)
Hope this helps
I suggest you use environment variables set on your server like this :
You must access the admin console of your server.
Under custom properties
Server_path=/abc/def/logs
In your log4j, use this : {$server_path}/log.txt
Make sure the user running the app has access to that directory.

External classes/jar in OSGi

My application supports running on many dbms and it requires user to configure dbms connection setting and also provide the jdbc jar file.
Now the application is to be packaged as OSGi bundle. There will be another main jar which lanches OSGi server and starts the application as bundle.
Can you please suggest how can I package the application as bundle and let user provide the jdbc jar file.
Will it require something like the main launcher jar specifying JDBC driver classes as FRAMEWORK_SYSTEMPACKAGES property?
Thanks in advance,
Aman
There are two ways of doing this:
1) Adding the driver.jar to the classpath of the main launcher and, like you say, expose its packages via the framework by specifying that property (or actually you can use the FRAMEWORK_SYSTEMPACKAGES_EXTRA property to just specify additional packages, instead of specifying all of them).
2) Manually wrapping the driver.jar as a bundle, or doing it dynamically at runtime. For example, you could try to wrap bundles that are copied to a certain folder (similar to what Apache Felix File Install does) by using Pax URL or some other tool that can create a bundle out of an ordinary jar file for you (see http://team.ops4j.org/wiki/display/paxurl/Pax+URL).

Unity 2.0 XML configuration possible?

Is it possible to use custom XML to store unity container configuration in my IoC class library project?
I dont want to store the IoC config at the startup project (WPF project).
Regards
Bryan
You can use ConfigurationManager.OpenMappedExeConfiguration to load an arbitrary file, but you'll need to do that yourself - the simpler overloads will go to the appdomain's config file by default.
If you have the Unity source code, you can look in the Unity\Tests\TestSupport.Unity\Configuration\ConfigFileLoader.cs file for an (perhap overly complex) example. There we pull a config file out of a resource, dump it to disk, and then load it via ConfigurationManager.

Resources