[Beginners Corner] - Reading properties file
by iamsonali
Hi,
I have an MBean, which along with other files is deployed as a .sar file in my application. I need to setup a properties file which will be read from this MBean file. I created a custom.properties file and placed it in META-INF.
To read it, I tried the following commands:
1) this.getClass().getClassLoader().getResource("custom.properties")
2) ClassLoader.getSystemClassLoader().getResource("/META-INF/custom.properties")
3) File props = new File("/META-INF/custom.properties");
None of these seem to work, I get null in return.
I do not have to place the file in META-INF, but I did this for my web application and read it in a servlet using -
file = "/META-INF/custom.properties";
config.getServletContext().getResourceAsStream(file);
and it worked.
I think the problem is that my java class cannot read the file from within the .sar file.
Does anyone have any suggestions? Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990112#3990112
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990112
18Â years, 1Â month
[JBoss Seam] - CVS icefaces example fails
by scosenz
The CVS icefaces example is failing with:
10:13:50,453 ERROR [D2DFaceletViewHandler] Problem in renderResponse: Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.seam.
com.sun.facelets.FaceletException: Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.seam.ui.facelet.SeamExpressionFactory
Using:
Current CVS (fresh checkout)
JBoss 4.0.5.GA (fresh install)
Changing "UseJBossWebLoader" in jboss-service.xml does not fix problem.
Full stack trace follows:
10:13:50,453 ERROR [D2DFaceletViewHandler] Problem in renderResponse: Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.seam.
com.sun.facelets.FaceletException: Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.seam.ui.facelet.SeamExpressionFactory
at com.sun.facelets.compiler.Compiler.featureInstance(Compiler.java:156)
at com.sun.facelets.compiler.Compiler.createExpressionFactory(Compiler.java:130)
at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:193)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:93)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:258)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:390)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Any advice?
Steve
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990111#3990111
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990111
18Â years, 1Â month
[JCA/JBoss] - Always the same managed connection
by oglueck
It seems the JBoss connection manager ignores the ConnectionRequestInfo when allocating new connections. What I do is:
conn1 = mycf.getConnection("abc");
conn2 = mycf.getConnection("def");
The connection factory basically passes the parameter as a ConnectionRequestInfo to the ConnectionManager.allocateConnection method. As it seems the connection manager always wants to return the same connection, even though the ConnectionRequestInfo for conn2 is different from conn1.
Can anybody confirm this?
I circumvented the problem by eliminating the parameter from getConnection. Thus I don't care anymore if I get the same connection back. But it still leaves me with a feeling that the JBoss ConnectionManager violates the JCA specs.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990108#3990108
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990108
18Â years, 1Â month