Marcos Gomes

Greenhorn
+ Follow
since Jul 02, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Marcos Gomes

Hello friends,

I'm trying to connect a DB in my application as follows:

------------------------------------------------------------
<sql:setDataSource var="db" url="jdbc:mysql://localhost/tpsg"
driver="com.mysql.jdbc.Driver" user="root" password="password"/>

<sql:transaction dataSource="db">

<sql:query var="menus">
SELECT * FROM menu_item order by id;
</sql:query>

</sql:transaction>
-------------------------------------------------------------

But Tomcat shows me the following error message:

javax.servlet.jsp.JspTagException: Error getting connection: "No suitable driver"
org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport.doStartTag(TransactionTagSupport.java:115)
org.apache.taglibs.standard.tag.el.sql.TransactionTag.doStartTag(TransactionTag.java:57)
org.apache.jsp.menu_jsp._jspx_meth_sql_005ftransaction_005f0(menu_jsp.java:173)
org.apache.jsp.menu_jsp._jspService(menu_jsp.java:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
-----------------------------------------------------------------

This is very intersting because when I use the same configuration with Hibernate, it works well:

<!-- mysql configuration -->
<property name="connection.url">jdbc:mysql://localhost/tpsg</property>
<property name="connection.username">root</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
--------------------------------------------------------
And when I use another DB as bellow, it works as well:

<sql:setDataSource var="db" url="jdbc:hsqldb b/menu"
driver="org.hsqldb.jdbcDriver" user="sa" password=""/>

<sql:transaction dataSource="db">

<sql:query var="menus">
SELECT * FROM menu_item order by id;
</sql:query>

</sql:transaction>
----------------------------------------------------------

Please, anyone has any idea why this happens ??

Thank you.

[]'s
Hello friends,

I'm trying to connect a DB in my application as follows:

------------------------------------------------------------
<sql:setDataSource var="db" url="jdbc:mysql://localhost/tpsg"
driver="com.mysql.jdbc.Driver" user="root" password="password"/>

<sql:transaction dataSource="db">

<sql:query var="menus">
SELECT * FROM menu_item order by id;
</sql:query>

</sql:transaction>
-------------------------------------------------------------

But Tomcat shows me the following error message:

javax.servlet.jsp.JspTagException: Error getting connection: "No suitable driver"
org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport.doStartTag(TransactionTagSupport.java:115)
org.apache.taglibs.standard.tag.el.sql.TransactionTag.doStartTag(TransactionTag.java:57)
org.apache.jsp.menu_jsp._jspx_meth_sql_005ftransaction_005f0(menu_jsp.java:173)
org.apache.jsp.menu_jsp._jspService(menu_jsp.java:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
-----------------------------------------------------------------

This is very intersting because when I use the same configuration with Hibernate, it works well:

<!-- mysql configuration -->
<property name="connection.url">jdbc:mysql://localhost/tpsg</property>
<property name="connection.username">root</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
--------------------------------------------------------
And when I use another DB as bellow, it works as well:

<sql:setDataSource var="db" url="jdbc:hsqldb b/menu"
driver="org.hsqldb.jdbcDriver" user="sa" password=""/>

<sql:transaction dataSource="db">

<sql:query var="menus">
SELECT * FROM menu_item order by id;
</sql:query>

</sql:transaction>
----------------------------------------------------------

Please, anyone has any idea why this happens ??

Thank you.

[]'s
16 years ago
Hello friends,

I'm trying to connect a DB in my application as follows:

------------------------------------------------------------
<sql:setDataSource var="db" url="jdbc:mysql://localhost/tpsg"
driver="com.mysql.jdbc.Driver" user="root" password="password"/>

<sql:transaction dataSource="db">

<sql:query var="menus">
SELECT * FROM menu_item order by id;
</sql:query>

</sql:transaction>
-------------------------------------------------------------

But Tomcat shows me the following error message:

javax.servlet.jsp.JspTagException: Error getting connection: "No suitable driver"
org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport.doStartTag(TransactionTagSupport.java:115)
org.apache.taglibs.standard.tag.el.sql.TransactionTag.doStartTag(TransactionTag.java:57)
org.apache.jsp.menu_jsp._jspx_meth_sql_005ftransaction_005f0(menu_jsp.java:173)
org.apache.jsp.menu_jsp._jspService(menu_jsp.java:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
-----------------------------------------------------------------

This is very intersting because when I use the same configuration with Hibernate, it works well:

<!-- mysql configuration -->
<property name="connection.url">jdbc:mysql://localhost/tpsg</property>
<property name="connection.username">root</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
--------------------------------------------------------
And when I use another DB as bellow, it works as well:

<sql:setDataSource var="db" url="jdbc:hsqldb:db/menu"
driver="org.hsqldb.jdbcDriver" user="sa" password=""/>

<sql:transaction dataSource="db">

<sql:query var="menus">
SELECT * FROM menu_item order by id;
</sql:query>

</sql:transaction>
----------------------------------------------------------

Please, anyone has any idea why this happens ??

Thank you.

[]'s
16 years ago
Hi guys,

I'm trying to use validator, but Tomcat throws the following exception:

18/04/2008 10:15:24 org.apache.struts.validator.ValidatorForm validate

SEVERE: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)

org.apache.commons.validator.ValidatorException: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)

at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Val
idatorAction.java:604)

...


*************************************************
The file validator-rules.xml seems to be correct:
*************************************************

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>

<global>

<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
msg="errors.required"/>

// other definitions

</global>

</form-validation>

*************************************************
And this is my validation.xml file:
*************************************************

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>
<formset>
<form name="ContactForm">
<field property="contact.company" depends="required">
<msg name="required" key="lilldep.error.company"/>
</field>
<field property="contact.name" depends="required">
<msg name="required" key="lilldep.error.name"/>
</field>
<field property="contact.email" depends="required">
<msg name="required" key="lilldep.error.email"/>
</field>
</form>
</formset>
</form-validation>

*************************************************

Please,

Somebody has already had this kind of problem and would help me to solve it ??

Thanks,

Marcos
16 years ago
Hi Piotr,

Thank you for your help !

Regards,
Marcos
Hi,

I�m looking for mock exams with questions about SCBCD 5.0.

I found some, but all of them have only questions about SCBCD 1.3.

Where could I find it ?

Thanks !!!