<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Java on The Dangling Pointer</title><link>https://aaron.blog/tags/java/</link><description>Recent content in Java on The Dangling Pointer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 06 Jan 2011 15:44:55 +0000</lastBuildDate><atom:link href="https://aaron.blog/tags/java/index.xml" rel="self" type="application/rss+xml"/><item><title>Hibernate 3.6.0.Final + PostgreSQL + CLOBs</title><link>https://aaron.blog/hibernate-3-6-0-final-postgresql-clobs/</link><pubDate>Thu, 06 Jan 2011 15:44:55 +0000</pubDate><guid>https://aaron.blog/hibernate-3-6-0-final-postgresql-clobs/</guid><description>&lt;p&gt;I recently upgraded a project I'm working on to Hibernate 3.6.0.Final from 3.5.6 and realized that one of my entities that had a CLOB (character large object) was pooping out.  I was getting an exception stack track similar to:&lt;/p&gt;&lt;p&gt;Caused by: org.postgresql.util.PSQLException: Bad value for type long : &amp;lt;table border="0" cellspacing="0" cellpadding="0" id="productDetailLineItems"&amp;gt;&amp;lt;thead&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td rowspan="2"&amp;gt;&amp;lt;input type="hidden" name="productGroupId" id="productGroupId" value="101111"/&amp;gt;Item Number&amp;lt;/td&amp;gt;&amp;lt;td rowspan="2"&amp;gt;Motor HP&amp;lt;/td&amp;gt;&amp;lt;td rowspan="2"&amp;gt;Price&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/thead&amp;gt;&amp;lt;tbody&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;form method="post" id="4581000" name="4581000" action&amp;gt;&amp;lt;td&amp;gt;4581000&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;span style="fraction"&amp;gt;&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;/&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type="button" onclick="javascript:addToCart('4581000');" value="$prc4581000" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/form&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSet.java:2690) [:]at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:1995) [:]at org.postgresql.jdbc3.Jdbc3ResultSet.getClob(Jdbc3ResultSet.java:44) [:]at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getClob(AbstractJdbc2ResultSet.java:373) [:]at org.jboss.resource.adapter.jdbc.WrappedResultSet.getClob(WrappedResultSet.java:516) [:6.0.0.Final]at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$2.doExtract(ClobTypeDescriptor.java:70) [:3.6.0.Final]at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) [:3.6.0.Final]at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253) [:3.6.0.Final]at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249) [:3.6.0.Final]at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:229) [:3.6.0.Final]at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:330) [:3.6.0.Final]at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2265) [:3.6.0.Final]at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527) [:3.6.0.Final]at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455) [:3.6.0.Final]at org.hibernate.loader.Loader.getRow(Loader.java:1355) [:3.6.0.Final]at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611) [:3.6.0.Final]at org.hibernate.loader.Loader.doQuery(Loader.java:829) [:3.6.0.Final]at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) [:3.6.0.Final]at org.hibernate.loader.Loader.loadEntity(Loader.java:2037) [:3.6.0.Final]... 167 more&lt;/p&gt;</description></item><item><title>Flush THIS Hibernate!</title><link>https://aaron.blog/flush-this-hibernate/</link><pubDate>Sat, 12 Jun 2010 12:25:41 +0000</pubDate><guid>https://aaron.blog/flush-this-hibernate/</guid><description>&lt;p&gt;I've been working with Hibernate 3.3.2 and Hibernate Search 3.1 for the past few months.  We finally got to a point in our project where we are sucking in mass amounts of data into our application from a large business application via JMS.  Suddenly, I'm getting the following errors during persistence:&lt;/p&gt;&lt;p&gt;org.hibernate.AssertionFailure: collection [ class name here ] was not processed by flush()&lt;/p&gt;&lt;p&gt;I tried changing the owning side of the collection, made a join table, and nothing helped.  The error started when I added an @IndexEmbedded annotation to the collection, and I discovered I was missing the @ContainedIn annotation in the collection entity.  That didn't fix it.  After weeks of doing little tweaks, breaking, fixing, breaking, fixing, I finally discovered the problem.  I was using an older manual for Hibernate Search (3.0 specifically) and I had the following configuration parameter pushed into my SessionFactory:&lt;/p&gt;</description></item><item><title>Google App Engine &amp; Java</title><link>https://aaron.blog/google-app-engine-java/</link><pubDate>Fri, 24 Apr 2009 20:46:12 +0000</pubDate><guid>https://aaron.blog/google-app-engine-java/</guid><description>&lt;p&gt;So I've spent a few days going over Google App Engine for Java.  So far, I have to say, I'm impressed.  Google has created a really cool service that lets anyone write a Java web application and host it on their multitude of servers.  This is all for free, I might add.  You have to be aware of a number of limitations including no threading and you're limited to their data store for persistence.  Once you get over that, you'll see the advantage of it:&lt;/p&gt;</description></item><item><title>Microsoft WCF Web Services &amp; Java</title><link>https://aaron.blog/microsoft-wcf-web-services-java/</link><pubDate>Fri, 06 Mar 2009 20:43:16 +0000</pubDate><guid>https://aaron.blog/microsoft-wcf-web-services-java/</guid><description>&lt;p&gt;I spent a good 50+ hours on trying to consume a Microsoft WCF secure web service with a Java solution.  I tried Spring Web Services, Axis2, and looked at Metro/Tango and decided Axis2 was the "easiest" solution.  The web service I'm connecting to implements WS-Security, WS-SecureConversation, WS-Policy, WS-Trust and WS-Addressing (at least) and it's provided through a .NET 3.5 WCF endpoint.&lt;/p&gt;&lt;p&gt;It doesn't work.&lt;/p&gt;&lt;p&gt;Axis2 can't handle SpNego which is a WCF closed protocol allowing two WCF machines to negotiate the credentials between them.  The client has spent way too much money paying me to continue to figure out a Java solution, so I wrote a .NET 3.5 C# client.  Took me literally five lines of code and it's working.  That's great for .NET developers but a whole lotta horse shit for the rest of the world.  I'm hoping Axis2's Rampart module is updated to play nice with WS-SecureConversation and a .NET WCF web service.  Until then, I'm using the .NET client to download the data and I'm storing the SOAP body into a database table.  On the Java side, I'm still using JAXB2 to unmarshall the data into Java objects and process it through our existing persistence framework.&lt;/p&gt;</description></item></channel></rss>