[Spring Integration] - Richfaces + Spring seems to cause null @Autowired properties
by Michael Angelo
Michael Angelo [http://community.jboss.org/people/mangelo123] created the discussion
"Richfaces + Spring seems to cause null @Autowired properties"
To view the discussion, visit: http://community.jboss.org/message/569373#569373
--------------------------------------------------------------
I am in a bind in a big way because this problem seems so obscure. I began developing an application using Spring and IceFaces a few weeks ago. I wasn't having any of the issues that I am over the last few days trying to convert to RichFaces.
Of course all of the backing Spring bean classes were moved right over. The proper adjustments were made in the web.xml file.
Upon running may application I see a blank form with all of the drop down lists populated as expected. I put a break point in a custom converter for one of the drop downs. I put this breakpoint on the getAsString method. This method does not involved the @Autowired property, but I can see the Spring correctly injected its value from within the debugger. All is good!!
On the subsequent view I retrieve a row from the database. There are quite a few @Autowired properties that have been injected just fine. In the debugger I now have a breakpoint on the getAsObject method. Once the debugger stops there my @Autowired property that is nedded in this method is null.
I cannot for the life of me see how moving to Richfaces could cause such a disaster, but I can't find anything thing else and am at my wits end!! I desperately want to move to RichFaces, but am in one hell of a bind!!!!
Please help!!!
Here is the custom converter bean:
*public
*class DocumentTypeConverter *implements Converter {
@AutowiredDDocumentTypeDAO dao;
@Override
*public Object getAsObject(FacesContext context, UIComponent ui, String id) {
DDocumentType docType =
dao.findById(id);
*return docType;}
@Override
*public String getAsString(FacesContext context, UIComponent ui, Object obj) {
*if (obj == *null) {
*return "";}
DDocumentType dt = (DDocumentType)obj;
*return dt.getDctypeD();}
*public DDocumentTypeDAO getDao() {
*return dao;}
*public *void setDao(DDocumentTypeDAO dao) {
*this.dao = dao;}
*
**
*
*
*
*
**
*
*
*
**
*
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569373#569373]
Start a new discussion in Spring Integration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[EJB3] - Stateless EJB lifecycle
by Ivan Pazmino
Ivan Pazmino [http://community.jboss.org/people/iapazmino] created the discussion
"Stateless EJB lifecycle"
To view the discussion, visit: http://community.jboss.org/message/569354#569354
--------------------------------------------------------------
I have a stateless ejb3 component that's serving to business methods an insert to the database and a query to the data base. In a @postconstruct method I get a connection from an injected datasource, and, in a @predestroy method i close the connection and null the datasource reference.
In a client I get a reference to the stateless component injected. Then, in different times, I call one of the method business and then the other. Always the that is called first performs its task and finishes successfully. But the second method fails complaining the connection is not associated with a managed connection.
Shouldn't the connection be alive as long as the slsb has not been destroyed?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569354#569354]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Cache] - Need help in configuring persistence in jboss cache
by Debayan Gupta
Debayan Gupta [http://community.jboss.org/people/debayan] created the discussion
"Need help in configuring persistence in jboss cache"
To view the discussion, visit: http://community.jboss.org/message/569239#569239
--------------------------------------------------------------
Hello,
While trying to configure Cache Loader, I'm facing a problem in specifying datasource property. Although the data source is configured in WAS, I'm getting a Naming Exception. Following is some excerpts :
Caused by: java.lang.IllegalStateException: Failed to lookup datasource java:/DefaultDatasource
at org.jboss.cache.loader.ManagedConnectionFactory.reportAndRethrowError(ManagedConnectionFactory.java:154)
at org.jboss.cache.loader.ManagedConnectionFactory.start(ManagedConnectionFactory.java:68)
at org.jboss.cache.loader.AdjListJDBCCacheLoader.start(AdjListJDBCCacheLoader.java:284)
at org.jboss.cache.loader.JDBCCacheLoader.start(JDBCCacheLoader.java:396)
at org.jboss.cache.loader.CacheLoaderManager.startCacheLoader(CacheLoaderManager.java:461)
... 30 more
Caused by: javax.naming.NameNotFoundException: Name not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:205)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:145)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at org.jboss.cache.loader.ManagedConnectionFactory.start(ManagedConnectionFactory.java:60)
Is there anyway to bound the datasource like how it is done in ejb-jar.xml? I'm using Websphere as application server.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/569239#569239]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months