Closed GoogleCodeExporter closed 9 years ago
Instead of using an InputStream, why don't you use a Reader?
In any case, you are not supposed to use the Value class directly.
Original comment by thomas.t...@gmail.com
on 1 Feb 2013 at 10:12
I see, but my case is wider. I am using the apache velocity engine v1.6.4
(http://velocity.apache.org/) within spring application. My templates are
stored in H2.
During preparing message, I get :
{exception}
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.util.StringUtils.convertHexToBytes(StringUtils.java:990)
at org.h2.value.Value.convertTo(Value.java:821)
at org.h2.value.Value.getBytesNoCopy(Value.java:393)
at org.h2.value.Value.getInputStream(Value.java:425)
at org.h2.jdbc.JdbcResultSet.getBinaryStream(JdbcResultSet.java:1029)
at org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader.getResourceStream(DataSourceResourceLoader.java:235)
at org.apache.velocity.Template.process(Template.java:98)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:446)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:354)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:370)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:345)
at org.springframework.ui.velocity.VelocityEngineUtils.mergeTemplate(VelocityEngineUtils.java:58)
at org.springframework.ui.velocity.VelocityEngineUtils.mergeTemplateIntoString(VelocityEngineUtils.java:122)
{exception}
As you can see, the DataSourceResourceLoader.getResourceStream uses within an
InputStream.
Original comment by sergiusz...@gmail.com
on 1 Feb 2013 at 10:29
Well, if you store data as a VARCHAR and then don't try to open it as a BLOB.
Just use BLOB.
For support, please use StackOverflow. The issue tracker isn't a support forum.
Original comment by thomas.t...@gmail.com
on 1 Feb 2013 at 10:57
I'll try. Thanks for suggestion and sorry for it.
Original comment by sergiusz...@gmail.com
on 1 Feb 2013 at 11:03
Original issue reported on code.google.com by
sergiusz...@gmail.com
on 1 Feb 2013 at 9:20