db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Atkins" <Brent.Atk...@Pro-Sys.biz>
Subject RE: maven torque:sql => Connection refused
Date Tue, 11 May 2004 13:35:38 GMT
It looks like you are missing a few properties in your project.properties.

Make sure you have these properties listed...

---

# Database access settings, set according to
# your environment

torque.database.user = [username]
torque.database.password = [password]
torque.database.host = localhost

torque.project = [projectName]
torque.targetPackage = [package]

torque.database = mysql
torque.database.createUrl = jdbc:mysql://localhost:3306/btp
torque.database.buildUrl = jdbc:mysql://localhost:3306/btp
torque.database.url = jdbc:mysql://localhost:3306/btp
torque.database.driver = com.mysql.jdbc.Driver

---

Your error looks like it is because it cannot connect to mySQL (or whatever database you are
using).
If you aren't using mysql, be sure to change your driver and database info to match your system.

You may also like to add this setting to it...

---

# Settings to generate torque docs in xdoc format
# and place in xdoc directory for inclusion in
# Maven site:generate goal

torque.doc.format = anakia
torque.doc.dir = xdocs/database

---

It'll make Torque output it's documents into the xml format used by Maven to generate the
site docs.
It's pretty useful.

When I was going through this process (on the older version) I also had to add a couple of
properties to fix it.  I don't know if these are still needed...

---

# Added to fix odd Torque plugin problem
# I'd like to eventually remove these

torque.basePrefix = Base
torque.addSaveMethod = true
torque.saveException = Exception

---

There were a couple other fixes I had to make (again, old version), but this should fix the
error
you are having right now.  Let me know if afterwards you get another error, I may be able
to help
with that one too.

-----Original Message-----
From: Nicolas.CHALUMEAU@arsoe-trelaze.com
[mailto:Nicolas.CHALUMEAU@arsoe-trelaze.com]
Sent: Tuesday, May 11, 2004 5:14 AM
To: torque-user@db.apache.org
Subject: maven torque:sql => Connection refused


I just want to create the sql from the project-schema.xml. Maybe I didn't
understand want this goal (torque:sql) do. I don't think that this goal
need to establish a connection with to data base but when I call maven
torque:sql I have an org.apache.torque.engine.EngineException:
java.net.ConnectException: Connection refused: connect.

My project.properties only contains this properties :
torque.schema.dir = src/main/torque

With maven -X torque:sql I have this stack trace :

[DEBUG] Class java.sql.SQLException loaded from parent loader
org.apache.torque.engine.EngineException: java.net.ConnectException:
Connection refused: connect
        at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:201)
        at
org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:341)
        at
org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:227)
        at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
...
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:426)
        at java.net.Socket.connect(Socket.java:376)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:303)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:264)
        at sun.net.www.http.HttpClient.New(HttpClient.java:336)
        at sun.net.www.http.HttpClient.New(HttpClient.java:317)
        at sun.net.www.http.HttpClient.New(HttpClient.java:312)
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:481)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:472)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
        at java.net.URL.openStream(URL.java:960)
        at
org.apache.torque.engine.database.transform.DTDResolver.getInputSource(DTDResolver.java:158)
        at
org.apache.torque.engine.database.transform.DTDResolver.resolveEntity(DTDResolver.java:144)
        at
org.apache.torque.engine.database.transform.XmlToAppData.resolveEntity(XmlToAppData.java:223)
        at
org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:192)
        ... 46 more
Root cause
org.apache.torque.engine.EngineException: java.net.ConnectException:
Connection refused: connect
        at
org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:364)
        at
org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:227)
        at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at
org.apache.commons.jelly.tags.core.WhenTag.doTag(WhenTag.java:92)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at
org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:84)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:78)
        at
org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:99)
        at com.werken.werkz.Goal.fire(Goal.java:639)
        at com.werken.werkz.Goal.attain(Goal.java:575)
        at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
        at
org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:126)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at
org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:87)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at
org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:84)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:78)
        at
org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:99)
        at com.werken.werkz.Goal.fire(Goal.java:639)
        at com.werken.werkz.Goal.attain(Goal.java:575)
        at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
        at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:531)
        at
org.apache.maven.MavenSession.attainGoals(MavenSession.java:265)
        at org.apache.maven.cli.App.doMain(App.java:466)
        at org.apache.maven.cli.App.main(App.java:1117)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)
Caused by: org.apache.torque.engine.EngineException:
java.net.ConnectException: Connection refused: connect
        at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:201)
        at
org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:341)
        ... 45 more
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:426)
        at java.net.Socket.connect(Socket.java:376)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:303)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:264)
        at sun.net.www.http.HttpClient.New(HttpClient.java:336)
        at sun.net.www.http.HttpClient.New(HttpClient.java:317)
        at sun.net.www.http.HttpClient.New(HttpClient.java:312)
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:481)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:472)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
        at java.net.URL.openStream(URL.java:960)
        at
org.apache.torque.engine.database.transform.DTDResolver.getInputSource(DTDResolver.java:158)
        at
org.apache.torque.engine.database.transform.DTDResolver.resolveEntity(DTDResolver.java:144)
        at
org.apache.torque.engine.database.transform.XmlToAppData.resolveEntity(XmlToAppData.java:223)
        at
org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:192)
        ... 46 more
--- Nested Exception ---
org.apache.torque.engine.EngineException: java.net.ConnectException:
Connection refused: connect
        at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:201)
        at
org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:341)
        at
org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:227)
...
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:426)
        at java.net.Socket.connect(Socket.java:376)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
...
Total time: 20 seconds
Finished at: Tue May 11 11:09:50 CEST 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message