Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 21129 invoked from network); 7 Jul 2005 15:37:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jul 2005 15:37:55 -0000 Received: (qmail 87768 invoked by uid 500); 7 Jul 2005 15:37:52 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 87740 invoked by uid 500); 7 Jul 2005 15:37:51 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 87726 invoked by uid 99); 7 Jul 2005 15:37:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2005 08:37:51 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_60_70,HTML_MESSAGE,HTML_TEXT_AFTER_BODY,HTML_TEXT_AFTER_HTML,NO_REAL_NAME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of erlend.bjorge@aftenposten.no designates 80.91.34.51 as permitted sender) Received: from [80.91.34.51] (HELO mx1.aftenposten.no) (80.91.34.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2005 08:35:07 -0700 Received: from localhost (amavis-mx1.aftenposten.no [80.91.34.52]) by mx1.aftenposten.no (Postfix) with ESMTP id BCDBD8D9341 for ; Thu, 7 Jul 2005 17:34:53 +0200 (CEST) Received: from smtp1.aftenposten.no (unknown [80.91.34.6]) by mx1.aftenposten.no (Postfix) with ESMTP id F0BFC8D9329 for ; Thu, 7 Jul 2005 17:34:50 +0200 (CEST) Received: from sch-mail-06.schibsted.no (unverified) by smtp1.aftenposten.no (Content Technologies SMTPRS 4.3.14) with ESMTP id for ; Thu, 7 Jul 2005 17:38:36 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C58309.6900F949" Subject: SAXParseException, parsing the sqlMap-config.xml file! Date: Thu, 7 Jul 2005 17:34:48 +0200 Message-ID: <013F0E81D349EC42A14CD3242BC61AFFF9A8E3@sch-mail-06.schibsted.no> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: SAXParseException, parsing the sqlMap-config.xml file! Thread-Index: AcWAUgnMdHMp4E4DRsG4VjGDyAHdugBJHXgAAGOcNRA= From: To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C58309.6900F949 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi there! =20 In my IntelliJ, in our Resin web applications it all works just fine = with SQLMap, but when I tries to=20 run a scheduler job (Quartz) from command prompt using SQLMap from a = .bat file (I run the job from IntelliJ it works fine) it seems that suddenly the parsing of the = config file is not working anymore. =20 I have also tried to copy the java command run by IntelliJ, into the bat = file I'm starting so I get as close as=20 I can get the same "environment" as the one in IntelliJ, still the same = problem. =20 Does anyone have any clues about what's wrong ? Some kind of conflict = with the dtd ??? but why now ? Can it be some kind of conflict of .jar files ? Need to change the = sequence ? Pretty lost here now. =20 Thanks for any clues! =20 Erlend Bj=F8rge =20 -------- =20 Here is the exception I get, check the red line where the exception = happens in my code, look further down. =20 ------- =20 java.lang.ExceptionInInitializerError at = no.aftenposten.multimedia.aguiden.bus.facade.FacadeFactory.getFacadeAdmin= (FacadeFactory.java:19) at = no.aftenposten.multimedia.aguiden.bus.common.batch.AGuidenDBUpdater.(AGuidenDBUpdater.java:42) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native = Method) at = sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAc= cessorImpl.java:39) at = sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConst= ructorAccessorImpl.java:27) at = java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.quartz.core.JobRunShell.initialize(JobRunShell.java:135) at = org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:335)= Caused by: com.ibatis.common.exception.NestedRuntimeException: Error = occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing = XML. Cause: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionMa nager?,sqlMap+)+". Caused by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+". Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. = Cause: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+". Caused by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+". at = com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfi= gParser.java:81) at = com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClie= ntBuilder.java:62) at = no.aftenposten.multimedia.aguiden.bus.facade.AgFacade.getSqlMapClient(AgF= acade.java:39) at = no.aftenposten.multimedia.aguiden.bus.facade.AgFacade.(AgFacade.j= ava:20) ... 10 more Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. = Cause: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+". Caused by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+". at = com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53) at = com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfi= gParser.java:78) ... 13 more Caused by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must match = "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+". at = org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213) at = org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLErro= r(XMLValidator.java:1851) at = org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValida= tor.java:1495) at = org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch= (XMLDocumentScanner.java:1149) at = org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScann= er.java:381) at = org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098) at = org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java= :195) at = com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150= ) at = com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50) ... 14 more =20 ---------------------------- =20 Here is my config file with the "correct" header: =20 ------------------------- =20 "> =20 =20 =20 =20 .... ..... ....... ......... =20 =20 ---------------------------- Here is my getSqlMapClient: ----------------------- =20 private static SqlMapClient getSqlMapClient() { =20 String resource =3D = "no/aftenposten/multimedia/aguiden/bus/dao/sql/sqlMap-config.xml"; =20 Reader reader =3D null; =20 try { reader =3D Resources.getResourceAsReader( resource ); } catch ( IOException e ) { System.out.println("############ GAME OVER = - SYSTEM.EXIT(-1) ############\n"); =20 System.out.println("############ FATAL ERROR, NOT ABLE = TO OPEN THE sqlMap-config.xml FILE ############"); System.out.println("############ " + resource + " = ############"); System.out.println("############ FATAL ERROR, NOT ABLE = TO OPEN THE sqlMap-config.xml FILE ############"); System.exit(-1); } =20 SqlMapClient sqlMap =3D SqlMapClientBuilder.buildSqlMapClient( = reader ); (Line 39, See red line in the exception) =20 return sqlMap; } ------_=_NextPart_001_01C58309.6900F949 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Melding=
Hi=20 there!
 
In my = IntelliJ, in=20 our Resin web applications it all works just fine with SQLMap,  but = when I=20 tries to
run a = scheduler job=20 (Quartz) from command prompt using SQLMap from a .bat = file (I=20 run the job
from = IntelliJ it=20 works fine) it seems that suddenly the parsing of = the config file is = not working=20 anymore.
 
I have = also tried to=20 copy the java command run by IntelliJ, into the bat file I'm starting so = I get=20 as close as
I can = get the=20 same=20 "environment" as the one in IntelliJ, still the same=20 problem.
 
Does = anyone have any=20 clues about what's wrong ? Some kind of conflict with the dtd ??? but = why now=20 ?
Can it = be some kind=20 of conflict of .jar files ? Need to change the sequence ? Pretty lost = here=20 now.
 
Thanks = for any=20 clues!
 
Erlend = Bj=F8rge
 
--------
 
Here is the=20 exception I get, check the red line where the exception happens in my = code, look=20 further down.
 
-------
 
java.lang.ExceptionInInitializerError
    = ;   =20 at=20 no.aftenposten.multimedia.aguiden.bus.facade.FacadeFactory.getFacadeAdmin= (FacadeFactory.java:19)
       =20 at=20 no.aftenposten.multimedia.aguiden.bus.common.batch.AGuidenDBUpdater.<i= nit>(AGuidenDBUpdater.java:42)
      =  =20 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native=20 Method)
        at=20 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAc= cessorImpl.java:39)
       =20 at=20 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConst= ructorAccessorImpl.java:27)
       = =20 at=20 java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 =       =20 at=20 java.lang.Class.newInstance0(Class.java:308)
    &= nbsp;  =20 at=20 java.lang.Class.newInstance(Class.java:261)
    &n= bsp;  =20 at=20 org.quartz.core.JobRunShell.initialize(JobRunShell.java:135)
 &nb= sp;     =20 at=20 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:335)=
Caused=20 by: com.ibatis.common.exception.NestedRuntimeException: Error = occurred. =20 Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  = Cause:=20 org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must=20 match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionMa
nager?,s= qlMap+)+".
Caused=20 by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig"=20 must match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+".
Caused=20 by: com.ibatis.common.xml.NodeletException: Error parsing XML.  = Cause:=20 org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig" must=20 match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+".
Caused=20 by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig"=20 must match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+".
       =20 at=20 com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfi= gParser.java:81)
       =20 at=20 com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClie= ntBuilder.java:62)
       =20 at=20 no.aftenposten.multimedia.aguiden.bus.facade.AgFacade.getSqlMapClient(AgF= acade.java:39)
       =20 at=20 no.aftenposten.multimedia.aguiden.bus.facade.AgFacade.<clinit>(AgFa= cade.java:20)
       =20 ... 10 more
Caused by: com.ibatis.common.xml.NodeletException: Error = parsing=20 XML.  Cause: org.xml.sax.SAXParseException: The content of element = type=20 "sqlMapConfig" must match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+".
Caused=20 by: org.xml.sax.SAXParseException: The content of element type = "sqlMapConfig"=20 must match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+".
       =20 at=20 com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)
 = ;      =20 at=20 com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfi= gParser.java:78)
       =20 ... 13 more
Caused by: org.xml.sax.SAXParseException: The content of = element=20 type "sqlMapConfig" must match=20 "(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMa= p+)+".
       =20 at=20 org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)       =20 at=20 org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLErro= r(XMLValidator.java:1851)
       =20 at=20 org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValida= tor.java:1495)
       =20 at=20 org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch= (XMLDocumentScanner.java:1149)
      &nb= sp;=20 at=20 org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScann= er.java:381)
       =20 at=20 org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
 = ;      =20 at=20 org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java= :195)
       =20 at=20 com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:150= )
       =20 at=20 com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50)
 = ;      =20 ... 14 more
 
----------------------------
 
Here is my=20 config file with the "correct" header:
 
-------------------------
 
<?xml=20 version=3D"1.0" encoding=3D"UTF-8" ?>
<!DOCTYPE sqlMapConfig = PUBLIC=20 "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd
= ">
 
<sqlMapConfig>
 
   =20 <properties = resource=3D"conf/sqlMap-config.properties"/>
 
   =20 <settings
       =20 cacheModelsEnabled=3D"true"
       = =20 enhancementEnabled=3D"true"
       = =20 lazyLoadingEnabled=3D"true"
       = =20 maxRequests=3D"256"
       =20 maxSessions=3D"128"
       =20 maxTransactions=3D"32"
       =20 useStatementNamespaces=3D"false"/>
 
   =20 <transactionManager type=3D"JDBC">
        <dataSource=20 type=3D"SIMPLE">
        &n= bsp;  =20 <property name=3D"JDBC.Driver"=20 value=3D"${driver}"/>
       &nb= sp;   =20 <property name=3D"JDBC.ConnectionURL"=20 value=3D"${url}"/>
        =    =20 <property name=3D"JDBC.Username"=20 value=3D"${username}"/>
       &= nbsp;   =20 <property name=3D"JDBC.Password"=20 value=3D"${password}"/>
....
.....
.......
.........
 
</sqlMapConfig>
 
----------------------------
Here is my=20 getSqlMapClient:
-----------------------
 
    private static = SqlMapClient=20 getSqlMapClient() {
 
        = String=20 resource =3D=20 "no/aftenposten/multimedia/aguiden/bus/dao/sql/sqlMap-config.xml";=
 
        = Reader=20 reader =3D null;
 
       =20 try = {
           =20 reader =3D Resources.getResourceAsReader( resource=20 );
        } catch ( IOException e = )=20 {
       &nbs= p;   =20 System.out.println("############       = ;          =20 GAME OVER -=20 SYSTEM.EXIT(-1)         &nbs= p;          =20 ############\n");
 
       &nbs= p;   =20 System.out.println("############     = FATAL=20 ERROR, NOT ABLE TO OPEN THE sqlMap-config.xml = FILE    =20 ############");
         =   =20 System.out.println("############ " + resource + "=20 ############");
         =   =20 System.out.println("############     FATAL ERROR, = NOT ABLE=20 TO OPEN THE sqlMap-config.xml FILE    =20 ############");
         =   =20 System.exit(-1);
       =20 }
 
       =20 SqlMapClient sqlMap =3D = SqlMapClientBuilder.buildSqlMapClient(=20 reader );   (Line 39, See red line in the=20 exception)
 
        = return sqlMap;
   =20 }
=00 ------_=_NextPart_001_01C58309.6900F949--