CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Error on multi-table selects

Print topic Send  topic

Author Message
dxtr
Posted: 09/22/2004, 6:11 AM

Using 2.3.2.24, winxpsp1, java 1.4.2_04, mysql 4.1.5, tomcat 4.1.30.

Steps to reproduce:
1. create 2 tables t1, t2 with 2 fields each (f1, f2). f1 should be primary key of each table, same type so they can be linked. Populate t1 and t2 with some sample data.

2. Make new project using application builder and above tables. Everthing works fine.

3. Now in the t2_list page, change the t2 grid datasource and build a query that joins the tables on f1. Tick f1 and f2 in t1 and t2. Review the data - all rows where t1.f1 = t2.f1 match should be displayed.

4. Add a column to the grid and add a label, make it's control source t1_f2. Adjust the f1 and f2 labels' control sources to be t2_f1 and t2_f2.

Republish the project, click the t2 link and the following error occurs: (this worked perfectly well with 2.2.3.60)

org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
etc ...

root cause

java.lang.NullPointerException
at com.codecharge.GridProcessor.bind(GridProcessor.java:274)
at com.codecharge.GridProcessor.select(GridProcessor.java:237)
at com.codecharge.GridProcessor.process(GridProcessor.java:65)
at com.codecharge.PageProcessor.process(PageProcessor.java:28)
at com.codecharge.PageController.process(PageController.java:155)
at org.apache.jsp.t2_list_jsp._jspService(t2_list_jsp.java:172)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
etc ...

Any ideas what's going on? Has anyone got mult-table selects to work on 2.3.2.24, or should it be reported as a bug??
srinivas

Posts: 54
Posted: 11/14/2004, 5:39 PM

There canbe any number of reasons for such a generic error. Some I can think of from my experience with CCS:

- Wrong type/initialization of controls on Grid/Record
- Wrong type/initialization of controls in Data Source on grid/record

-Srinivas
View profile  Send private message
Jar
Posted: 01/28/2005, 10:01 AM

I ran into this same problem using 2.3.2.24/Oracle

First, I pointed against a simple table with no foreign keys ... and it worked fine. After I changed 2 columns to be foreign keys, I started over in CodeCharge, pointed to the table like before, published, and now I get the null pointer in the GridProcessor.bind().

I added some debugging statements and the problem lies with the Grid object ('model').

at about line 255 in GridProcessor.java ....

if (isNew) {
Iterator children = model.getChildren().iterator();
while (children.hasNext()) {
Model child = (Model)children.next();
System.out.println("child = " + child);
if (child instanceof Control) {
Control ctrl = (Control)((Control)child).clone();
ctrl.setHtmlName(ctrl.getName() + "_" + n);

the 'child' object is null the first time through .... even tho the database returned a legitimate record.

Are there some limits as to database field names?

Quote dxtr:
Using 2.3.2.24, winxpsp1, java 1.4.2_04, mysql 4.1.5, tomcat 4.1.30.

Steps to reproduce:
1. create 2 tables t1, t2 with 2 fields each (f1, f2). f1 should be primary key of each table, same type so they can be linked. Populate t1 and t2 with some sample data.

2. Make new project using application builder and above tables. Everthing works fine.

3. Now in the t2_list page, change the t2 grid datasource and build a query that joins the tables on f1. Tick f1 and f2 in t1 and t2. Review the data - all rows where t1.f1 = t2.f1 match should be displayed.

4. Add a column to the grid and add a label, make it's control source t1_f2. Adjust the f1 and f2 labels' control sources to be t2_f1 and t2_f2.

Republish the project, click the t2 link and the following error occurs: (this worked perfectly well with 2.2.3.60)

org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
etc ...

root cause

java.lang.NullPointerException
at com.codecharge.GridProcessor.bind(GridProcessor.java:274)
at com.codecharge.GridProcessor.select(GridProcessor.java:237)
at com.codecharge.GridProcessor.process(GridProcessor.java:65)
at com.codecharge.PageProcessor.process(PageProcessor.java:28)
at com.codecharge.PageController.process(PageController.java:155)
at org.apache.jsp.t2_list_jsp._jspService(t2_list_jsp.java:172)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
etc ...

Any ideas what's going on? Has anyone got mult-table selects to work on 2.3.2.24, or should it be reported as a bug??

peterr


Posts: 5971
Posted: 01/28/2005, 12:51 PM

Not sure if this is a bug but you could try contacting the support.
I would just like to point that possibly you just need to reselect the value of the "Control Source" property after changing the Data Source. Sometimes when you add a new table or fields then the the resulting fields may be based on aliases, therefore the previous field names (in Control Source) will no longer work.

As for the limits on database field names, yes, every database and programming language has a list of reserved words that shouldn't be used.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.