Help needed migration JBoss 5.1 to Wildfly
dagor_06 Aug 11, 2014 3:22 AMHello, I'm trying to migrate from JBoss AS 5.1 to Wildfly.
I'm deploying the application using Netbeans 8 with Wildfly plugin and JDK1.7.0_25 and here is the error I got :
07:52:33,010 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./MyApplicationServer" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./MyApplicationServer: Failed to start service Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ldap.LdapConfigLoader]: Constructor threw exception; nested exception is java.util.MissingResourceException: Can't find bundle for base name customLdap, locale fr_FR at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:110) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) ... 100 more Caused by: java.util.MissingResourceException: Can't find bundle for base name customLdap, locale fr_FR at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499) [rt.jar:1.7.0_25] at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322) [rt.jar:1.7.0_25] at java.util.ResourceBundle.getBundle(ResourceBundle.java:721) [rt.jar:1.7.0_25] at com.edf.marketlab.ldap.LdapConfigLoader.<init>(LdapConfigLoader.java:22) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_25] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_25] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_25] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_25] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
My web.xml file contains the following :
<context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:org/codehaus/xfire/spring/xfire.xml classpath:META-INF/xfire/services.xml /WEB-INF/classes/com/path/to/applicationContext-services.xml /WEB-INF/classes/com/path/to/applicationContext-jms.xml /WEB-INF/classes/com/path/to/applicationContext-dbaccess-production.xml /WEB-INF/classes/com/path/to/applicationContext.xml /WEB-INF/classes/com/path/to/applicationContext-designable-object.xml /WEB-INF/classes/com/path/to/applicationContext-security.xml /WEB-INF/classes/com/path/to/applicationContext-droit.xml </param-value> </context-param>
where applicationContext-security.xml is as the following :
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <bean id="ldapConfigLoader" class="com.ldap.LdapConfigLoader"> <constructor-arg index="0" value="customLdap" /> </bean> <bean id="myLdapConfig" factory-bean="ldapConfigLoader" factory-method="getProperties" /> <bean id="authenticatorLdap" class="com.ldap.SimpleAuthenticator"> <constructor-arg ref="myLdapConfig" /> </bean> <bean id="nameUserSearch" class="com.ldap.UserSearch"> <constructor-arg ref="authenticatorLdap" /> <property name="filter" value="sn=?*" /> </bean> <bean id="nniUserSearch" class="com.ldap.UserSearch"> <constructor-arg ref="authenticatorLdap" /> </bean> </beans>
The class LdapConfigLoader is as follow :
public class LdapConfigLoader { Properties instance = new Properties(); public LdapConfigLoader(String fileName) throws IOException{ if(System.getProperty("jboss.home.dir") != null){ ResourceBundle fileBundle = ResourceBundle.getBundle(fileName); Enumeration<String> keys = fileBundle.getKeys(); while (keys.hasMoreElements()) { String key = keys.nextElement(); instance.put(key, fileBundle.getString(key)); } }else{ InputStream inStream = this.getClass().getResourceAsStream(fileName+".properties"); instance.load(inStream); inStream.close(); } } public Properties getProperties(){ return instance; } }
In JBoss 5.1 I have a customLdap.properties file in $JBOSS_HOME/server/default/conf
Thanks for helping.