Re: error - serialization
On Thu, 7 Jul 2011 12:36:45 +0200 "Miroslav F." wrote: > After investigation I will answer myself - it is bug in tomcat, if > you are using tomcat > 6.0.29 upgrade to 6.0.31. Sounds like an interesting bug. Do you have any more information on this? > Carl, static variables are good if you are going to do something like > "DB connection > factory" and you will reuse existing connection. When you will do in > your style you will > make new connection in each request (it is expensive). It is more expensive manually, yes, but that is why I advised you to use tools like JPA or iBATIS that will manage the connection for you, or at least use a DataSource. Just keeping a static variable around *will* *break* your application, because it is not thread safe. As soon as you have more than one concurrent user, this will break. Carl-Eric www.wicketbuch.de - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error - serialization
On Thu, Jul 7, 2011 at 12:36 PM, Miroslav F. wrote: > After investigation I will answer myself - it is bug in tomcat, if you are > using tomcat > 6.0.29 upgrade to 6.0.31. > > Carl, static variables are good if you are going to do something like "DB > connection > factory" and you will reuse existing connection. When you will do in your > style you will > make new connection in each request (it is expensive). Better use objects with application scope than statics. There is a lot of reading in the web about the drawbacks of static fields. > > > >> -Original Message- >> From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] >> Sent: Wednesday, 06. July 2011 13:13 >> To: users@wicket.apache.org >> Subject: Re: error - serialization >> >> First of all, don't manage your own DB connection. That is >> fragile and error-prone. The best solution is to use >> something like Hibernate, iBatis, JPA or any other such tool. >> These things manage the connection setup for you, and you >> don't have to worry about it. >> >> Second, in this particular case, get rid of all the static variables. >> I'm not entirely sure what exactly is causing the "no >> suitable driver found" issue, but keeping connections and all >> this stuff around statically is thread-unsafe and can cause >> all kinds of confusion. If you have to do the DBImage and >> Database stuff, do it like this (pseudocode, you get the idea): >> >> byte[] getRecord { >> try { >> Connection c = makeConnection(); >> Statement s = makeStatement(); >> } finally { >> // ...cleanup... >> } >> } >> >> Basically, move all the static stuff into method-local >> variables to get rid of threading issues. >> >> Carl-Eric >> www.wicketbuch.de >> >> On Tue, 5 Jul 2011 11:35:31 +0200 >> "Miroslav F." wrote: >> >> > Index.java: >> > public class Index extends WebPage >> > { >> > public Index() >> > { >> > add(new Image("obrazokzdb", new ImagesIndex())); >> > } >> > } >> > >> > ImagesIndex.java: >> > public class ImagesIndex extends LoadableDetachableModel { >> > private DBImage myImage; >> > >> > @Override >> > protected Object load() >> > { >> > myImage = new DBImage(); >> > myImage.setImageData(Database.getRecord()); >> > return myImage; >> > } >> > } >> > >> > DBImage.java: >> > public class DBImage extends DynamicImageResource { >> > private byte[] imageData; >> > >> > @Override >> > protected byte[] getImageData() >> > { >> > return this.imageData; >> > } >> > >> > public void setImageData(byte[] inputImageData) >> > { >> > this.imageData = inputImageData; >> > } >> > } >> > >> > Database.java (poor organisation, at the moment just >> testing working >> > with BLOBs): >> > public class Database >> > { >> > private static Connection connection; >> > private static Statement statement; >> > private static ResultSet result; >> > private static LargeObject object; >> > private static LargeObjectManager manager; >> > private static String query = "SELECT * FROM >> mydatabase.images WHERE >> > id = 8"; >> > private static byte[] record; >> > >> > public static byte[] getRecord() >> > { >> > makeConnection(); >> > makeStatement(); >> > makeResultSet(); >> > try >> > { >> > result.next(); >> > Long oid = result.getLong(7); >> > object = manager.open(oid, >> > LargeObjectManager.READ); record = new byte[object.size()]; >> > object.read(record, 0, object.size()); >> > object.close(); >> > closeResultSet(); >> > closeStatement(); >> > makeCommit(); >> > } >> > catch(SQLException e) >> > { >> > e.printStackTrace(); >> >
RE: error - serialization
After investigation I will answer myself - it is bug in tomcat, if you are using tomcat 6.0.29 upgrade to 6.0.31. Carl, static variables are good if you are going to do something like "DB connection factory" and you will reuse existing connection. When you will do in your style you will make new connection in each request (it is expensive). > -Original Message- > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > Sent: Wednesday, 06. July 2011 13:13 > To: users@wicket.apache.org > Subject: Re: error - serialization > > First of all, don't manage your own DB connection. That is > fragile and error-prone. The best solution is to use > something like Hibernate, iBatis, JPA or any other such tool. > These things manage the connection setup for you, and you > don't have to worry about it. > > Second, in this particular case, get rid of all the static variables. > I'm not entirely sure what exactly is causing the "no > suitable driver found" issue, but keeping connections and all > this stuff around statically is thread-unsafe and can cause > all kinds of confusion. If you have to do the DBImage and > Database stuff, do it like this (pseudocode, you get the idea): > > byte[] getRecord { > try { > Connection c = makeConnection(); > Statement s = makeStatement(); > } finally { > // ...cleanup... > } > } > > Basically, move all the static stuff into method-local > variables to get rid of threading issues. > > Carl-Eric > www.wicketbuch.de > > On Tue, 5 Jul 2011 11:35:31 +0200 > "Miroslav F." wrote: > > > Index.java: > > public class Index extends WebPage > > { > > public Index() > > { > > add(new Image("obrazokzdb", new ImagesIndex())); > > } > > } > > > > ImagesIndex.java: > > public class ImagesIndex extends LoadableDetachableModel { > > private DBImage myImage; > > > > @Override > > protected Object load() > > { > > myImage = new DBImage(); > > myImage.setImageData(Database.getRecord()); > > return myImage; > > } > > } > > > > DBImage.java: > > public class DBImage extends DynamicImageResource { > > private byte[] imageData; > > > > @Override > > protected byte[] getImageData() > > { > > return this.imageData; > > } > > > > public void setImageData(byte[] inputImageData) > > { > > this.imageData = inputImageData; > > } > > } > > > > Database.java (poor organisation, at the moment just > testing working > > with BLOBs): > > public class Database > > { > > private static Connection connection; > > private static Statement statement; > > private static ResultSet result; > > private static LargeObject object; > > private static LargeObjectManager manager; > > private static String query = "SELECT * FROM > mydatabase.images WHERE > > id = 8"; > > private static byte[] record; > > > > public static byte[] getRecord() > > { > > makeConnection(); > > makeStatement(); > > makeResultSet(); > > try > > { > > result.next(); > > Long oid = result.getLong(7); > > object = manager.open(oid, > > LargeObjectManager.READ); record = new byte[object.size()]; > > object.read(record, 0, object.size()); > > object.close(); > > closeResultSet(); > > closeStatement(); > > makeCommit(); > > } > > catch(SQLException e) > > { > > e.printStackTrace(); > > } > > return record; > > } > > > > public static void makeConnection() > > { > > try > > { > > Class.forName("org.postgresql.Driver"); > > connection = > > > DriverManager.getConnection("jdbc:postgresql://localhost:5432/mydataba > > se", > > "postgres", "postgres"); > > connection.setAutoCommit(false); > > manager = ((org.postgresql.PGConnection) > > connection).getLargeObjectAPI(); > > } >
Re: error - serialization
; { > e.printStackTrace(); > } > } > > public static ResultSet getResultSet() > { > return result; > } > > public static LargeObjectManager getLargeObjectManager() > { > return manager; > } > > public static void closeResultSet() > { > > try > { > result.close(); > } > catch(SQLException e) > { > e.printStackTrace(); > } > } > > public static void closeStatement() > { > try > { > statement.close(); > } > catch(SQLException e) > { > e.printStackTrace(); > } > } > > public static void makeCommit() > { > try > { > connection.commit(); > } > catch(SQLException e) > { > e.printStackTrace(); > } > } > } > > > > > -Original Message- > > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > > Sent: Tuesday, 05. July 2011 10:37 > > To: users@wicket.apache.org > > Subject: Re: error - serialization > > > > Code. I suspect there's something going wrong within the > > LoadableDetachableModel, for example. Can you show the code > > of your page and model? > > > > Carl-Eric > > www.wicketbuch.de > > > > On Tue, 5 Jul 2011 10:08:33 +0200 > > "Miroslav F." wrote: > > > > > Code or project layout? Driver for ostgreSQL JDBC is in tomcat > > > "lib" directory and code is standard > > > init and usage code from jdbc.postgresql.org examples. It works > > > but from some reason just for first time. When I do F5 on page > > or redeploy > > > project error occurs - see my original post (look at the end): > > > > > http://apache-wicket.1842946.n4.nabble.com/error-serialization-td36416 > > > 36.htm > > > l > > > > > > Miro > > > > > > > -Original Message- > > > > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > > > > Sent: Monday, 04. July 2011 20:47 > > > > To: users@wicket.apache.org > > > > Subject: Re: error - serialization > > > > > > > > Can you show some code? > > > > > > > > Carl-Eric > > > > > > > > On Mon, 4 Jul 2011 08:02:16 +0200 > > > > "Miroslav F." wrote: > > > > > > > > > Driver is in classpath and is initialized. When I start > > tomcat, it > > > > > works (load images from database) but when i redeploy or > > > > reload page > > > > > (F5) it complains about "java.sql.SQLException: No > > suitable driver > > > > > found...". I have to restart tomcat and than it works again. > > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: error - serialization
Martijn, thanks for pointing me this :-) Problem with JDBC driver still remains :-( > -Original Message- > From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] > Sent: Tuesday, 05. July 2011 12:39 > To: users@wicket.apache.org > Subject: Re: error - serialization > > On Tue, Jul 5, 2011 at 11:35 AM, Miroslav F. wrote: > > ImagesIndex.java: > > public class ImagesIndex extends LoadableDetachableModel { > > private DBImage myImage; > > > > @Override > > protected Object load() > > { > > myImage = new DBImage(); > > myImage.setImageData(Database.getRecord()); > > return myImage; > > } > > } > > Don't do this, LDM already caches the model object for you, > and now you have bound the DBImage to the LDM. > > Instead do: > > public class ImagesIndex extends LoadableDetachableModel { > @Override > protected Object load() > { > DBImage myImage = new DBImage(); > myImage.setImageData(Database.getRecord()); > return myImage; > } > } > > Martijn > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error - serialization
On Tue, Jul 5, 2011 at 11:35 AM, Miroslav F. wrote: > ImagesIndex.java: > public class ImagesIndex extends LoadableDetachableModel > { > private DBImage myImage; > > @Override > protected Object load() > { > myImage = new DBImage(); > myImage.setImageData(Database.getRecord()); > return myImage; > } > } Don't do this, LDM already caches the model object for you, and now you have bound the DBImage to the LDM. Instead do: public class ImagesIndex extends LoadableDetachableModel { @Override protected Object load() { DBImage myImage = new DBImage(); myImage.setImageData(Database.getRecord()); return myImage; } } Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: error - serialization
Index.java: public class Index extends WebPage { public Index() { add(new Image("obrazokzdb", new ImagesIndex())); } } ImagesIndex.java: public class ImagesIndex extends LoadableDetachableModel { private DBImage myImage; @Override protected Object load() { myImage = new DBImage(); myImage.setImageData(Database.getRecord()); return myImage; } } DBImage.java: public class DBImage extends DynamicImageResource { private byte[] imageData; @Override protected byte[] getImageData() { return this.imageData; } public void setImageData(byte[] inputImageData) { this.imageData = inputImageData; } } Database.java (poor organisation, at the moment just testing working with BLOBs): public class Database { private static Connection connection; private static Statement statement; private static ResultSet result; private static LargeObject object; private static LargeObjectManager manager; private static String query = "SELECT * FROM mydatabase.images WHERE id = 8"; private static byte[] record; public static byte[] getRecord() { makeConnection(); makeStatement(); makeResultSet(); try { result.next(); Long oid = result.getLong(7); object = manager.open(oid, LargeObjectManager.READ); record = new byte[object.size()]; object.read(record, 0, object.size()); object.close(); closeResultSet(); closeStatement(); makeCommit(); } catch(SQLException e) { e.printStackTrace(); } return record; } public static void makeConnection() { try { Class.forName("org.postgresql.Driver"); connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/mydatabase", "postgres", "postgres"); connection.setAutoCommit(false); manager = ((org.postgresql.PGConnection) connection).getLargeObjectAPI(); } catch(ClassNotFoundException e) { e.printStackTrace(); } catch(SQLException e) { e.printStackTrace(); } } public static void makeStatement() { try { statement = connection.createStatement(); } catch(SQLException e) { e.printStackTrace(); } } public static void setQuery(String inputQuery) { query = null; query = inputQuery; } public static void makeResultSet() { try { result = statement.executeQuery(query); } catch(SQLException e) { e.printStackTrace(); } } public static ResultSet getResultSet() { return result; } public static LargeObjectManager getLargeObjectManager() { return manager; } public static void closeResultSet() { try { result.close(); } catch(SQLException e) { e.printStackTrace(); } } public static void closeStatement() { try { statement.close(); } catch(SQLException e) { e.printStackTrace(); } } public static void makeCommit() { try { connection.commit(); } catch(SQLException e) { e.printStackTrace(); } } } > -Original Message- > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > Sent: Tuesday, 05. July 2011 10:37 > To: users@wicket.apache.org > Subject: Re: error - serialization > > Code. I suspect there
Re: error - serialization
Code. I suspect there's something going wrong within the LoadableDetachableModel, for example. Can you show the code of your page and model? Carl-Eric www.wicketbuch.de On Tue, 5 Jul 2011 10:08:33 +0200 "Miroslav F." wrote: > Code or project layout? Driver for ostgreSQL JDBC is in tomcat "lib" > directory and code is standard > init and usage code from jdbc.postgresql.org examples. It works but > from some reason just for first > time. When I do F5 on page or redeploy project error occurs - see my > original post (look at the end): > http://apache-wicket.1842946.n4.nabble.com/error-serialization-td3641636.htm > l > > Miro > > > -Original Message- > > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > > Sent: Monday, 04. July 2011 20:47 > > To: users@wicket.apache.org > > Subject: Re: error - serialization > > > > Can you show some code? > > > > Carl-Eric > > > > On Mon, 4 Jul 2011 08:02:16 +0200 > > "Miroslav F." wrote: > > > > > Driver is in classpath and is initialized. When I start tomcat, > > > it works (load images from database) but when i redeploy or > > reload page > > > (F5) it complains about "java.sql.SQLException: No suitable > > > driver found...". I have to restart tomcat and than it works > > > again. > > > > > > > -Original Message- > > > > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > > > > Sent: Sunday, 03. July 2011 23:22 > > > > To: users@wicket.apache.org > > > > Subject: Re: error - serialization > > > > > > > > That means you don't have the appropriate driver jar in your > > > > classpath. > > > > You need the PostgreSQL driver jar, put it on your classpath, > > > > and initialize it. > > > > > > > > Carl-Eric > > > > www.wicketbuch.de > > > > > > > > On Sun, 3 Jul 2011 23:08:40 +0200 > > > > "Miroslav F." wrote: > > > > > > > > > Still problem with "no suitable driver found" > > > > > > > > > > Does someone has experience with this and solved it? > > > > > > > > > > Miro > > > > > > > > > > > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: error - serialization
Code or project layout? Driver for ostgreSQL JDBC is in tomcat "lib" directory and code is standard init and usage code from jdbc.postgresql.org examples. It works but from some reason just for first time. When I do F5 on page or redeploy project error occurs - see my original post (look at the end): http://apache-wicket.1842946.n4.nabble.com/error-serialization-td3641636.htm l Miro > -Original Message- > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > Sent: Monday, 04. July 2011 20:47 > To: users@wicket.apache.org > Subject: Re: error - serialization > > Can you show some code? > > Carl-Eric > > On Mon, 4 Jul 2011 08:02:16 +0200 > "Miroslav F." wrote: > > > Driver is in classpath and is initialized. When I start tomcat, it > > works (load images from database) but when i redeploy or > reload page > > (F5) it complains about "java.sql.SQLException: No suitable driver > > found...". I have to restart tomcat and than it works again. > > > > > > > -Original Message- > > > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > > > Sent: Sunday, 03. July 2011 23:22 > > > To: users@wicket.apache.org > > > Subject: Re: error - serialization > > > > > > That means you don't have the appropriate driver jar in your > > > classpath. > > > You need the PostgreSQL driver jar, put it on your classpath, and > > > initialize it. > > > > > > Carl-Eric > > > www.wicketbuch.de > > > > > > On Sun, 3 Jul 2011 23:08:40 +0200 > > > "Miroslav F." wrote: > > > > > > > Still problem with "no suitable driver found" > > > > > > > > Does someone has experience with this and solved it? > > > > > > > > Miro > > > > > > > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error - serialization
Can you show some code? Carl-Eric On Mon, 4 Jul 2011 08:02:16 +0200 "Miroslav F." wrote: > Driver is in classpath and is initialized. When I start tomcat, it > works (load images > from database) but when i redeploy or reload page (F5) it complains > about "java.sql.SQLException: No suitable driver found...". I have to > restart tomcat and than > it works again. > > > > -Original Message- > > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > > Sent: Sunday, 03. July 2011 23:22 > > To: users@wicket.apache.org > > Subject: Re: error - serialization > > > > That means you don't have the appropriate driver jar in your > > classpath. > > You need the PostgreSQL driver jar, put it on your classpath, > > and initialize it. > > > > Carl-Eric > > www.wicketbuch.de > > > > On Sun, 3 Jul 2011 23:08:40 +0200 > > "Miroslav F." wrote: > > > > > Still problem with "no suitable driver found" > > > > > > Does someone has experience with this and solved it? > > > > > > Miro > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: error - serialization
Driver is in classpath and is initialized. When I start tomcat, it works (load images from database) but when i redeploy or reload page (F5) it complains about "java.sql.SQLException: No suitable driver found...". I have to restart tomcat and than it works again. > -Original Message- > From: Carl-Eric Menzel [mailto:cmen...@wicketbuch.de] > Sent: Sunday, 03. July 2011 23:22 > To: users@wicket.apache.org > Subject: Re: error - serialization > > That means you don't have the appropriate driver jar in your > classpath. > You need the PostgreSQL driver jar, put it on your classpath, > and initialize it. > > Carl-Eric > www.wicketbuch.de > > On Sun, 3 Jul 2011 23:08:40 +0200 > "Miroslav F." wrote: > > > Still problem with "no suitable driver found" > > > > Does someone has experience with this and solved it? > > > > Miro > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error - serialization
That means you don't have the appropriate driver jar in your classpath. You need the PostgreSQL driver jar, put it on your classpath, and initialize it. Carl-Eric www.wicketbuch.de On Sun, 3 Jul 2011 23:08:40 +0200 "Miroslav F." wrote: > Still problem with "no suitable driver found" > > Does someone has experience with this and solved it? > > Miro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FW: error - serialization
Still problem with "no suitable driver found" Does someone has experience with this and solved it? Miro > -Original Message- > From: Miroslav F. [mailto:mir...@seznam.cz] > Sent: Sunday, 03. July 2011 10:14 > To: users@wicket.apache.org > Subject: error - serialization > > Folks, > > another problem of my testing app - I have this error in > tomcat console (looks like app is stil working): > ... > 9094 [http-80-1] ERROR org.apache.wicket.util.lang.Objects - > Error serializing object class com.mypackage.Index > [object=[Page class = com.mypackage.Index, id = 2, version = > 0]] > org.apache.wicket.util.io.SerializableChecker$WicketNotSeriali > zableException > : Unable to serialize class: org.postgresql.jdbc4.Jdbc4Connection > Field hierarchy is: > 2 [class=com.mypackage.Index, path=2] > private java.sql.Connection com.mypackage.Index.conn > [class=org.postgresql.jdbc4.Jdbc4Connection] <- field > that is not serializable > at > org.apache.wicket.util.io.SerializableChecker.internalCheck(Se > rializableChec > ker.java:372) > ... > > and after redeploy app I have JDBC error in tomcat log: > java.sql.SQLException: No suitable driver found for > jdbc:postgresql://localhost:5432/mydatabase > When I restart tomcat, JDBC error is left. Maybe wrong > version of tomcat? > Does someone experience with this? > > My environment is: > WinXP 32bit SP3 > Eclipse 3.5.2 J2EE > Tomcat 6.0.29 > Java 1.6.0_24 > Wicket 1.4.13 > JDBC driver postgresql-9.0-801.jdbc4.jar PostgreSQL 9.0 > > Does someone has been faced with same errors and solved them? > > Thanks, > > Miro > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: error - serialization
Alexander, it (of course..) works, thanks for pointing me right direction. Miro > -Original Message- > From: Alexander Morozov [mailto:alexander.v.moro...@gmail.com] > Sent: Sunday, 03. July 2011 11:27 > To: users@wicket.apache.org > Subject: Re: error - serialization > > You have JDBC Connection reference within Index page > implementation. Check LoadableDetachableModel and never store > Connection and other JDBC stuff within wicket components. > > > - > -- > http://www.linkedin.com/in/amorozov > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/error-serialization -tp3641636p3641695.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: error - serialization
You have JDBC Connection reference within Index page implementation. Check LoadableDetachableModel and never store Connection and other JDBC stuff within wicket components. - -- http://www.linkedin.com/in/amorozov -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/error-serialization-tp3641636p3641695.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
error - serialization
Folks, another problem of my testing app - I have this error in tomcat console (looks like app is stil working): ... 9094 [http-80-1] ERROR org.apache.wicket.util.lang.Objects - Error serializing object class com.mypackage.Index [object=[Page class = com.mypackage.Index, id = 2, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException : Unable to serialize class: org.postgresql.jdbc4.Jdbc4Connection Field hierarchy is: 2 [class=com.mypackage.Index, path=2] private java.sql.Connection com.mypackage.Index.conn [class=org.postgresql.jdbc4.Jdbc4Connection] <- field that is not serializable at org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChec ker.java:372) ... and after redeploy app I have JDBC error in tomcat log: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/mydatabase When I restart tomcat, JDBC error is left. Maybe wrong version of tomcat? Does someone experience with this? My environment is: WinXP 32bit SP3 Eclipse 3.5.2 J2EE Tomcat 6.0.29 Java 1.6.0_24 Wicket 1.4.13 JDBC driver postgresql-9.0-801.jdbc4.jar PostgreSQL 9.0 Does someone has been faced with same errors and solved them? Thanks, Miro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org