NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Component Error in Visual Web Design View

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
Geziefer



Joined: 14 May 2010
Posts: 4

PostPosted: Fri May 14, 2010 2:42 pm    Post subject: Component Error in Visual Web Design View Reply with quote

Hello,

I am using NB 6.7.1 with Visual Web plugin, jdk 1.6_20, MySQL 5.1, Tomcat 6.0.20 and Windows XP SP 3.
I have a Visual Web JSF project with JSPs containing tables (webuijsf:table) displaying data from an sql query. The data is bound via a CachedRowSetDataProvider (located in the backing bean) and a CachedRowSetXImpl (located in the session bean). The latter contains the sql command querying rows for the table to display in its _init method..

When deploying and running the application on Tomcat, everything works fine.
But for some reason, I am no longer able to see the design view in NetBeans. I get a message "Component Error - Cannot display the table component in the Visual Design editor. [..] java.sql.SQLException: SQL String can not be NULL [..]". And when I click on continue, I see a nearly empty view. When I delete the CachedRowSetDataProvider, I see everything on the view, of course without bound data in the table.

So, my question is, what can cause such a problem and what might help to solve it?
And additionally, why would I need an sql connection during development when displaying the view in the editor?

Thanks in advance,
Geziefer
Back to top
jyeary



Joined: 21 Oct 2008
Posts: 608
Location: Simpsonville, SC

PostPosted: Fri May 14, 2010 2:51 pm    Post subject: Re: Component Error in Visual Web Design View Reply with quote

Do you have the link set up to the database in Netbeans?


On Fri, May 14, 2010 at 10:43 AM, Geziefer <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hello,

I am using NB 6.7.1 with Visual Web plugin, jdk 1.6_20, MySQL 5.1, Tomcat 6.0.20 and Windows XP SP 3.
I have a Visual Web JSF project with JSPs containing tables (webuijsf:table) displaying data from an sql query. The data is bound via a CachedRowSetDataProvider (located in the backing bean) and a CachedRowSetXImpl (located in the session bean). The latter contains the sql command querying rows for the table to display in its _init method..

When deploying and running the application on Tomcat, everything works fine.
But for some reason, I am no longer able to see the design view in NetBeans. I get a message "Component Error - Cannot display the table component in the Visual Design editor. [..] java.sql.SQLException: SQL String can not be NULL [..]". And when I click on continue, I see a nearly empty view. When I delete the CachedRowSetDataProvider, I see everything on the view, of course without bound data in the table.

So, my question is, what can cause such a problem and what might help to solve it?
And additionally, why would I need an sql connection during development when displaying the view in the editor?

Thanks in advance,
Geziefer







--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the grey twilight that knows not victory nor defeat."
-- Theodore Roosevelt
Back to top
Geziefer



Joined: 14 May 2010
Posts: 4

PostPosted: Fri May 14, 2010 6:21 pm    Post subject: Reply with quote

Quote:
Do you have the link set up to the database in Netbeans?

Which link do you mean?

I have my database connection listed under Services/Databases and it is also listed in the project's Data Source References.

Is there anything else to do?

As I said, it works when running, but it gives the mentioned error in the visual editor.
Back to top
Geziefer



Joined: 14 May 2010
Posts: 4

PostPosted: Sat May 15, 2010 7:02 am    Post subject: Reply with quote

I was able to fix it by myself.

Here's what caused it, in case you are facing the same problem:
The RowSet's sql command is usually configured with its own editor and then placed in the (Session bean's) _init method via myRowSet.setCommand(..)
I had replaced that with a dynamically created query, which works fine when running, but is not recognized by the editor.

So, I still wonder
a) how to realize that without a statically set command?
b) why it is necessary to have a database connection and working sql command while editing the file?
Back to top
Ho, Michelle M.
Posted via mailing list.





PostPosted: Tue May 18, 2010 4:32 pm    Post subject: Re: Component Error in Visual Web Design View Reply with quote

I have seen the same problem. Do you by chance have the data provider defined somewhere other than your page bean? If so, create a provider variable in your page bean and assign it the value wherever your real variable resides. This should fix the problem. For some reason the visual editor has a problem binding to variables outside of the page class (at least where data providers are concerned).

From: John Yeary [mailto:address-removed]
Sent: Friday, May 14, 2010 7:52 AM
To: nbj2ee
Subject: [nbj2ee] Re: Component Error in Visual Web Design View


Do you have the link set up to the database in Netbeans?
On Fri, May 14, 2010 at 10:43 AM, Geziefer <address-removed ([email]address-removed[/email])> wrote:
Hello,

I am using NB 6.7.1 with Visual Web plugin, jdk 1.6_20, MySQL 5.1, Tomcat 6.0.20 and Windows XP SP 3.
I have a Visual Web JSF project with JSPs containing tables (webuijsf:table) displaying data from an sql query. The data is bound via a CachedRowSetDataProvider (located in the backing bean) and a CachedRowSetXImpl (located in the session bean). The latter contains the sql command querying rows for the table to display in its _init method..

When deploying and running the application on Tomcat, everything works fine.
But for some reason, I am no longer able to see the design view in NetBeans. I get a message "Component Error - Cannot display the table component in the Visual Design editor. [..] java.sql.SQLException: SQL String can not be NULL [..]". And when I click on continue, I see a nearly empty view. When I delete the CachedRowSetDataProvider, I see everything on the view, of course without bound data in the table.

So, my question is, what can cause such a problem and what might help to solve it?
And additionally, why would I need an sql connection during development when displaying the view in the editor?

Thanks in advance,
Geziefer







--
John Yeary
--
http://javaevangelist.blogspot.com

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the grey twilight that knows not victory nor defeat."
-- Theodore Roosevelt
Back to top
Geziefer



Joined: 14 May 2010
Posts: 4

PostPosted: Thu May 20, 2010 6:14 pm    Post subject: Reply with quote

Quote:
I have seen the same problem. Do you by chance have the data provider defined somewhere other than your page bean? If so, create a provider variable in your page bean and assign it the value wherever your real variable resides. This should fix the problem. For some reason the visual editor has a problem binding to variables outside of the page class (at least where data providers are concerned).


Thank you for the hint, but it's the other way round, the data provider is in the page bean and the cached row set is in the session bean.
But anyway, even when putting both into the page bean, I still have the problem, that the string for the data provider's sql query is not a static string, but gets dynamically processed first. I fear that in order to display correctly, it has to be something static, right?
Back to top
Cenwig



Joined: 04 Apr 2011
Posts: 2
Location: los angeles

PostPosted: Mon Apr 04, 2011 8:03 am    Post subject: Reply with quote

Maybe the link you have been you use is have an error so you experience some error in visual. Try to remove the link you have been use in design the web you have. However, you can try to search in online by using some search engine like google and yahoo.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo