jpetstore and Sun Appserver
Is it possible to deploy JPetstore on Sun Appserver? I tried simple war deploying but to no avail. There's not even an error message or anything, it just wouldn't acknowledge it's there. Cheers!
Re: Is this possible in iBatis?
Yes, the properties element will let you use either a resource or a URL as the location of the properties file. A resource is loaded from the class loader and as such, needs to be on the class path. In a web application, you could put it in a jar in your WEB-INF/lib directory, or in a directory in WEB-INF/classes, and the class loader will find it. Resource examples include com/company/system/config/ibatis.propertes or just simple ibatis.properties instead. A URL is loaded with the URLConnection class, so any URL that Java is aware of will work in iBATIS. For example, jar:file:/somedir/config.jar!/ibatis-dev.properties. If you really had a need, you could even use http://somehost/config/somefile.properties;, and iBATIS would dutifully load the properties from that URL. You need to find the appropriate URL, and it will work. Larry On Tue, 25 Jan 2005 12:57:28 -, Adrian Harrison [EMAIL PROTECTED] wrote: I have an EAR (PRDApp) containing several EJB's a single WAR file. I have a prd.system.properties file that currently contains the data source name iBatis use's to get a connection from a Weblogic connection pool. i.e datasourcename=PRDDataSource So my sql-map-config.xml file looks something like this - sqlMapConfig properties resource = prd.system.properties / . . transactionManager type=EXTERNAL dataSource type=JNDI property name=DBFullJndiContext value=${datasourcename}/ /dataSource /transactionManager This works fine but I want to use this file to contain other settings used by other modules. So I've placed it in the App directory but changing the line to - properties resource = ./applications/PRDApp/system.properties / but this produces - javax.ejb.EJBException: Error in ejbCreate:: java.lang.ExceptionInInitializerError . Caused by: java.lang.RuntimeException: Could not initialize DaoConfig. Cause: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance. --- The error occurred in ./applications/PRDApp/prd.system.properties. --- The error occurred while loading global properties. --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error loading properties. Cause: java.io.IOException: Could not find resource ./applications/PRDApp/prd.system.properties . Is it possible to get iBatis to use this file? if so any ideas what the resource line should be? Many thanks harry
iBatis and Weblogic
Hi all, i'm implementing an application, based on the JPetStore architecture, the same architecture, and i'm deploying it on a Weblogic 6.1. When i run my application, a have the following error, while the system initializes the DaoConfig..like follows: java.lang.ExceptionInInitializerError: java.lang.RuntimeException: Could not initialize DaoConfig. Cause: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: java.lang.ClassCastException: weblogic.apache.xerces.dom.DeferredCommentImpl Caused by: java.lang.ClassCastException: weblogic.apache.xerces.dom.DeferredCommentImpl at com.telefonica.webapp.rectraf.dao.DaoConfig.clinit(DaoConfig.java:22) at com.telefonica.webapp.rectraf.service.AbstractService.init(AbstractService.java:11) at com.telefonica.webapp.rectraf.service.EstadoService.init(EstadoService.java:15) at com.telefonica.webapp.rectraf.action.tarifaChamada.ListarAction.executeAction(ListarAction.java:27) at com.telefonica.webapp.rectraf.actions.RecTrafAction.execute(RecTrafAction.java:131) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Anyone has an idea what is causing this error? Regards. Alexandre Martins.
Re: referencing complex POJO properties for parameters in inserts
There really is no advantage to doing this in your DAO. Typically, I would do it this way (with struts, if you are using something else, it would work the same way): MyStrutsAction - MyBusinessLogic - MyDao - SqlMap In the MyBusinessLogic class, I do the looping before the dao layer, and keep the DAO layer simple - it has only to insert a single object. Larry On Tue, 25 Jan 2005 17:56:01 +1000, Andrew Fooks [EMAIL PROTECTED] wrote: Clinton has said that the iterate tag isn't really designed for the above usage, so I guess it's time to refactor. Anyone have any suggestions?
Re: Problems with implicit HashMap result mapping
Anyone get a chance to look at this yet? On Jan 25, 2005, at 3:36 PM, Nathan Maves wrote: Here is our sqlmap query select id=getShipped resultClass=java.util.HashMap select al1.parts__t as part, SUM(al1.qty_despatched) as shipped from despatch AL1, despatch_header AL2 where AL1.despatch_note__T = al2.despatch_note__T and trunc(AL2.despatch_date,'MON') = add_months(trunc(sysdate,'MON'),-1) AND AL1.request_orig in ('BRR','CM') group by al1.parts__t /select And the logs DEBUG 01-25 13:32:39 Created connection 23667197. (SimpleDataSource.java:480) DEBUG 01-25 13:32:39 {conn-10} Connection (ConnectionLogProxy.java:24) DEBUG 01-25 13:32:39 {pstm-11} PreparedStatement: select al1.parts__t as part, SUM(al1.qty_despatched) as shipped from despatch AL1, despatch_header AL2 where AL1.despatch_note__T = al2.despatch_note__T and trunc(AL2.despatch_date,'MON') = add_months(trunc(sysdate,'MON'),-1) AND AL1.request_orig in ('BRR','CM') group by al1.parts__t (PreparedStatementLogProxy.java:30) DEBUG 01-25 13:32:39 {pstm-11} Parameters: [] (PreparedStatementLogProxy.java:31) DEBUG 01-25 13:32:39 {pstm-11} Types: [] (PreparedStatementLogProxy.java:32) DEBUG 01-25 13:36:20 {rset-12} ResultSet (ResultSetLogProxy.java:25) DEBUG 01-25 13:36:21 {rset-12} Header: [, PART] (ResultSetLogProxy.java:45) DEBUG 01-25 13:36:21 {rset-12} Result: [100-6889, 44] (ResultSetLogProxy.java:49) DEBUG 01-25 13:36:21 {rset-12} Result: [100-7192, 1] (ResultSetLogProxy.java:49) DEBUG 01-25 13:36:21 {rset-12} Result: [100-7270, 7] (ResultSetLogProxy.java:49) Why is the first field null in the Header of the ResultSet? PART should be the first element in the header. Nathan
Re: iBatis and Weblogic
Anyone please could help me with this? Does Weblogic 6.1 has support for iBatis? Sincerelly i don't know what's happening and i really need to make it work, in order to convince my manager to use ibatis Cheers. On Wed, 26 Jan 2005 14:27:39 -0300, Alexandre Nunes [EMAIL PROTECTED] wrote: Hi all, i'm implementing an application, based on the JPetStore architecture, the same architecture, and i'm deploying it on a Weblogic 6.1. When i run my application, a have the following error, while the system initializes the DaoConfig..like follows: java.lang.ExceptionInInitializerError: java.lang.RuntimeException: Could not initialize DaoConfig. Cause: com.ibatis.dao.client.DaoException: Error while configuring DaoManager. Cause: java.lang.ClassCastException: weblogic.apache.xerces.dom.DeferredCommentImpl Caused by: java.lang.ClassCastException: weblogic.apache.xerces.dom.DeferredCommentImpl at com.telefonica.webapp.rectraf.dao.DaoConfig.clinit(DaoConfig.java:22) at com.telefonica.webapp.rectraf.service.AbstractService.init(AbstractService.java:11) at com.telefonica.webapp.rectraf.service.EstadoService.init(EstadoService.java:15) at com.telefonica.webapp.rectraf.action.tarifaChamada.ListarAction.executeAction(ListarAction.java:27) at com.telefonica.webapp.rectraf.actions.RecTrafAction.execute(RecTrafAction.java:131) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Anyone has an idea what is causing this error? Regards. Alexandre Martins.
Indexed properties in tags within iterate
Hi, Is this legal: update id=createDynamicTable parameterClass=dynamicTableDefinition CREATE TABLE a_dynamic_table iterate property=columnList open=( close=) conjuction=, $columnList[].name$ isEqual property=columnList[].type compareValue=int INTEGER NULL /isEqual isEqual property=columnList[].type compareValue=double DOUBLE NULL /isEqual /iterate /update As you might expect, I'm trying to build a dynamic table from a java.util.List of beans each with a name and type property. Currently, I'm getting an expection when iBatis (2.0.9) is trying to access the columnList[].type value in the isEqual tag. Is this sort of construct legal? Thanks, Philippe Here are parts of the stacktrace that might be helpful: [...] --- The error occurred in dynamicTable.xml. --- The error occurred while preparing the mapped statement for execution. --- Check the createDynamicTable. --- Check the parameter map. [...] Caused by: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: Caused by: java.lang.NumberFormatException: For input string: at com.ibatis.common.beans.BaseProbe.getIndexedProperty(BaseProbe.java:80) at com.ibatis.common.beans.JavaBeanProbe.getProperty(JavaBeanProbe.java:261) at com.ibatis.common.beans.JavaBeanProbe.getObject(JavaBeanProbe.java:245) at com.ibatis.common.beans.GenericProbe.getObject(GenericProbe.java:55) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.ConditionalTagHandler.compare(ConditionalTagHandler.java:60) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.IsEqualTagHandler.isCondition(IsEqualTagHandler.java:21) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.ConditionalTagHandler.doStartFragment(ConditionalTagHandler.java:40) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:129) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:138) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:99) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.process(DynamicSql.java:79) at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.getParameterMap(DynamicSql.java:61) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:55) ... 27 more