could not find a provider for the InitialContextFactory com.sonicsw.jndi.mfcontext.MFContextFactory - jms

I am getting this exception when i am trying to start the WAS server. I have created JMS providers in console and set all the jar files in the classpath.
External initial context factory defined is com.sonicsw.jndi.mfcontext.MFContextFactory with a valid URL.
I am not sure if the issue is with websphere configuration settings or code.
Can someone please provide any context to move forward?

Can you add more information?
classpath, properties set up for your connector
check this documentation :
http://documentation.progress.com/output/Sonic/8.5.1/jca_books/resadapwas_guide.pdf
regards

Related

Liberty Profile - Remote EJB

I am trying to call a remote ejb from my application and getting error
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: javax.naming.NameNotFoundException: CNTR4009E: The edu.osu.cse5234.ooth.business.view.InventoryService remote interface for the InventoryServiceBean enterprise bean in the OutOfTheHouse-EJB.jar module in the OutOfTheHouse-EJBEAR application could not be obtained for the java:global/OutOfTheHouse-EJBEAR/OutOfTheHouse-EJB/InventoryServiceBean!edu.osu.cse5234.ooth.business.view.InventoryService JNDI name because remote interfaces are not supported by any of the features configured in the server.xml file.
I found that we need to add
<featureManager>
<feature>ejbRemote-3.2</feature>
<feature>localConnector-1.0</feature>
</featureManager>
but I am not getting an option to add ejbRemote in my server.xml.
What could be the reason?
Open server.xml, view in the Design mode (as opposed to Source mode), expand Server Configuration and click on Feature Manager. On the right side feature manager deatails will be listed. Click on Add. Add the following features:
ejblite-3.2
javaee-7.0
jndi-1.0
localConnnector-1.0
Additionally, make sure the EAR project is added to WAS liberty profile. Increase console log level to INFO (Server Manager --> Add --> Logging then edit console log level in the details window). The console output will spit out the JNDI name exactly as generated by the container. Copy paste into ServiceLocator code.
Praveen
I get this error as soon as I enable features "webProfile-7.0" or "javaee-7.0". These features load other features and it seems that one of them prevents the EJB from being bound. Also there is no log entry containing the JNDI name in this case. To solve this issue I just enable the features I really need (servlet-3.1, localConnector-1.0, ejbLite-3.2, ejbRemote-3.2, jsp-2.3 in my case). This also speeds up server start.
The problem was with the version of liberty profile I was using. I used a different one and I was able to add javaee-7.0 as feature and after that it worked fine.

How to specify JDBC setting in a struts project?

I am trying to setup a struts project locally. One way I know to set up JDBC settings as to go to administrative console of websphere and create JDBC provider and JNDI and all. But is there any other way to do in the code itself?
There is some resource reference in web.xml. I am totally new to struts.Please help.
DataSourceAlias
javaxsql.Data...... etc etc
If you configured for WAS 6.1and configuration is good you need to stop and start nodeAgents for the changes to get propagated and test the jdbc connection after restarting.....if it was WAS 8 they will be propagated automatically that means you configured improperly

Configuring WebLogic Logging for Commons Logging

I'm writing a Spring web application deployed to a WebLogic 10.3.3 server. I've tried to enable logging as described by the Oracle documentation here: http://docs.oracle.com/cd/E14571_01/web.1111/e13739/config_logs.htm#WLLOG154
Both commons-logging-1.1.1.jar and com.bea.core.weblogic.commons.logging_1.4.0.0.jar are placed in the lib folder of the WebLogic domain, and I'm attempting to initialize the logger exactly as described in the Oracle example. I see the following exception in the server console:
Caused by: org.apache.commons.logging.LogConfigurationException: The chosen
LogFactory implementation does not extend LogFactory. Please check your
configuration. (Caused by java.lang.ClassCastException:weblogic.logging.commons.LogFactoryImpl)
Does anyone know of any possible solutions?
Works for me. Seems like a classloader issue.
Check whether another commons-logging lib is not loaded before application provided commons-logging.

Weblogic javax.naming.NameNotFoundException while running application

I have created a data source name in Weblogic 10.3.6 as jdbc/appsmDS and the same name has been given in application to lookup.
However when I am trying to run application, I am getting the following error
javax.naming.NameNotFoundException: While trying to lookup 'jdbc/appsmDS'
didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/appsmDS'
How can I resolve this issue?
The problem in this case is probably that the datasource is not deployed in the "server" inside weblogic domain.
when looking up the DS the full JNDI structure maps to java:jdbc/appsmsDS.
Please use it for lookup.
This exception happens when the property provider.url is pointing at the AdminServer (localhost:7001, in my case) and JDBC is not installed.
You may have other instances where it is installed, check your JNDI TREE to verify this.
Greetings,
JFM
javax.naming.NameNotFoundException: This will generally occur if any of the xml files like ejb-jar.xml and weblogic-ejbjar.xml are missing in the ear file deployed. The only workaround is to generate a fresh ear file with all the xml files included.
Make sure you have clicked on the "Activate Changes" button on the left top corner and also check your xxxxxxDataSource-nnnn-jdbc.xml file is created under config/jdbc directory.

Having spring bean properties refreshed automatically from properties file

I'm using Spring 2.5.6. I have a bean whose properties are being assign from a property file via a PropertyPlaceholderConfigurer. I'm wondering whether its possible to have the property of the bean updated when the property file is modified. There would be for example some periodic process which checks the last modified date of the property file, and if it has changed, reload the bean.
I'm wondering if there is already something that satisfies my requirements. If not, what would be the best approach to solving this problem?
Thanks for your help.
Might also look into useing Spring's PropertyOverrideConfigurer. Could re-read the properties and re-apply it in some polling/schedular bean.
It does depend on how the actual configured beans use these properties. They might, for example, indirectly cache them somewhere themself.
If you want dynamic properties at runtime, perhaps another way to do it is JMX.
One way to do this is to embed a groovy console in your application. Here's some instructions. They were very simple to do, btw - took me very little time even though I'm not that familiar with groovy.
Once you do that you can simply go into the console and change values inside the live application on the fly.
You might try to use a custom scope for the bean that recreates beans on changes of the properties file. See my more extensive answer here.
Spring Cloud Config has facilities to change configuration properties at runtime via the Spring Cloud Bus and using a Cloud Config Server. The configuration or .properties or .yml files are "externalized" from the Spring app and instead retrieved from a Spring Cloud Config Server that the app connects to on startup. That Cloud Config Server retrieves the appropriate configuration .properties or .yml files from a GIT repo (there are other storage solutions, but GIT is the most common). You can then change configuration at runtime by changing the contents of the GIT repo's configuration files--The Cloud Config Server broadcasts the changes to any Client Spring applications via the Spring Cloud Bus, and those applications' configuration is updated without needing a restart of the app. You can find a working simple example here: https://github.com/ldojo/spring-cloud-config-examples

Resources