-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Spinning my wheels - Websphere 7 + Oracle's XMLTYPE
PostPosted: Wed Sep 08, 2010 2:14 pm 
Newbie

Joined: Wed Sep 08, 2010 2:00 pm
Posts: 2
Hello,
I have been spinning my wheels for days now and any help is greatly appreciated.

I am using the solution posted at http://community.jboss.org/wiki/MappingXMLtoOracleXMLTYPEinIBMWebspshereplatform to act as my custom type for handling the XMLTYPE.

In my annotation, I have the following

Code:

@Entity
@Table(name="GROUP_NOTIFICATION_FORM")
@TypeDefs(
{
@TypeDef(name = "xmlMap", typeClass = com.company.app.product.tadgis.configuration.WebsphereXMLMapping.class)
})
public class Test extends BaseBean {
   @Transient
   private static final long serialVersionUID = 1L;
   
   @Id
   @SequenceGenerator(name="gnfID", sequenceName = "GNF_ID")
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "gnfID")
   @Column(name="GNF_FORM_ID", nullable = false)
   private int GNF_FORM_ID;

   @Column(name ="XML_DOCUMENT", updatable=true, insertable=true)
   @Type(type="xmlMap")
   private Document xmlDocument = null;
   
   @Column(name = "CREATED_TS", nullable = true)
   private Timestamp createdTS = null;




   public Document getXmlDocument() {
      return xmlDocument;
   }

   public void setXmlDocument(Document xmlDocument) {
      System.out.println("DEBUG ---> document to be set " + xmlDocument.getChildNodes().getLength());
      this.xmlDocument = xmlDocument;
   }
...
}


When I comment out
Code:
@Column(name ="XML_DOCUMENT", updatable=true, insertable=true)
@Type(type="xmlMap")
private Document xmlDocument = null;


Everything works great! It's just this XMLTYPE that is giving me grief.

Here is the exception I see..
Code:
[9/8/10 14:09:21:892 EDT] 00000014 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet TestPinglet in application tadgis. Exception created : java.lang.ExceptionInInitializerError
   at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
   at com.company.app.product.tadgis.facade.TADGISBusinessFacade.saveTest(TADGISBusinessFacade.java:81)
   at com.company.app.product.tadgis.servlets.TestPinglet.insertTest(TestPinglet.java:231)
   at com.company.app.product.tadgis.servlets.TestPinglet.doGet(TestPinglet.java:78)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:937)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
   at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
   at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3810)
   at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
   at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
   at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
   at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:183)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
   at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
   at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
   at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
   at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
   at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
   at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
   at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
   at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
   at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.lang.NullPointerException
   at org.hibernate.type.CustomType.getColumnSpan(CustomType.java:101)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
   at org.hibernate.mapping.Property.isValid(Property.java:207)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
   at com.company.app.product.tadgis.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:114)
   at com.company.app.product.tadgis.util.HibernateUtil.<clinit>(HibernateUtil.java:80)
   at java.lang.J9VMInternals.initializeImpl(Native Method)
   at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
   ... 27 more


I have run this code in debugging mode and still can't find the source of my problems. Again, everything works great (row is inserted using hibernate) when I have the @Type annotation commented out.

Please let me know if I can provide any more information that may help.

Thanks for looking, and especially your help!


Top
 Profile  
 
 Post subject: Re: Spinning my wheels - Websphere 7 + Oracle's XMLTYPE
PostPosted: Wed Sep 08, 2010 4:31 pm 
Newbie

Joined: Wed Sep 08, 2010 2:00 pm
Posts: 2
I changed
Code:
@Column(name ="XML_DOCUMENT", updatable=true, insertable=true)
@Type(type="xmlMap")
private Document xmlDocument = null;


to

Code:
@Type(type="com.company.app.product.tadgis.configuration.WebsphereXMLMapping")
@Column(name ="XML_DOCUMENT", updatable=true, insertable=true)
private Document XML_DOCUMENT = null;


and it started working. I'm new to Hibernate and I'm following my companies 'Template Project' implementation so I am sure there are a lot of things I will learn like this along the way.

Thanks again!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


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

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.