14 Replies Latest reply on Dec 4, 2015 2:40 AM by Prakruti Pathik

    Where should resource bundles be located in JBOSS AS 7

    Richard Clarke Newbie

      Hi,

      I am migrating an application from JBOSS AS 6 to AS 7 and have a question on resource bundles.

       

      I have a properties file   'searchpoint.properties'  with many key=value pairs.

      Under AS 6 this lived in the conf directory i.e. JBOSS_HOME/server/default/conf/searchpoint.properties

       

      I access  these properties via the following code...

       

      ResourceBundle propertiesFile = ResourceBundle.getBundle("searchpoint");

      String returnValue = propertiesFile.getString(propertyName).trim();

       

       

      My question is where should this file be located under AS 7? I have tried  JBOSS_HOME\standalone\configuration\searchpoint.properties but this doesn't work, I get the error... Can't find bundle for base name searchpoint, locale en_GB

       

      Stack trace...

       

      Caused by: org.jboss.weld.exceptions.CreationException: WELD-000079 Could not find the EJB in JNDI:  class com.vesey.searchpoint.session.SearchOrderBean$Proxy$_$$_Weld$Proxy$

              at org.jboss.weld.bean.SessionBean.create(SessionBean.java:357) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:122) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at com.vesey.searchpoint.session.SearchOrderBean$Proxy$_$$_WeldClientProxy.getPostcodeMatchesFound(SearchOrderBean$Proxy$_$$_WeldClientProxy.java) [classes:]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_20]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]

              at javax.el.BeanELResolver.getValue(BeanELResolver.java:302) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]

              at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

              at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

              at org.apache.el.parser.AstValue.getValue(AstValue.java:134) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:55) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

              ... 50 more

      Caused by: java.lang.IllegalStateException: Failed to construct component instance

              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:153)

              at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:76)

              at org.jboss.as.ejb3.component.stateful.StatefulSessionComponent$1.createInstance(StatefulSessionComponent.java:92)

              at org.jboss.as.ejb3.component.stateful.StatefulSessionComponent$1.createInstance(StatefulSessionComponent.java:89)

              at org.jboss.as.ejb3.component.stateful.ExpiringCache.create(ExpiringCache.java:143)

              at org.jboss.as.ejb3.component.stateful.StatefulSessionComponent.createSession(StatefulSessionComponent.java:187)

              at org.jboss.as.weld.ejb.StatefulSessionObjectReferenceImpl.<init>(StatefulSessionObjectReferenceImpl.java:60) [jboss-as-weld-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.as.weld.services.bootstrap.WeldEjbServices.resolveEjb(WeldEjbServices.java:60) [jboss-as-weld-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.weld.bean.SessionBean.createReference(SessionBean.java:483) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.<init>(EnterpriseBeanProxyMethodHandler.java:75) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              at org.jboss.weld.bean.SessionBean.create(SessionBean.java:340) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

              ... 65 more

      Caused by: java.util.MissingResourceException: Can't find bundle for base name searchpoint, locale en_GB

              at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427) [:1.6.0_20]

              at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250) [:1.6.0_20]

              at java.util.ResourceBundle.getBundle(ResourceBundle.java:705) [:1.6.0_20]

              at com.vesey.searchpoint.Utils.getStringProperty(Utils.java:355) [classes:]

              at com.vesey.searchpoint.session.SearchOrderBean.postConstruct(SearchOrderBean.java:208) [classes:]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_20]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]

              at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:69)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.jpa.interceptor.SFSBCreateInterceptor.processInvocation(SFSBCreateInterceptor.java:53) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:73) [jboss-as-weld-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.jpa.interceptor.SFSBPreCreateInterceptor.processInvocation(SFSBPreCreateInterceptor.java:46) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:151)

       

       

       

      Thanks

      Rich