[Solved] java.lang.IllegalArgumentException: node to traverse cannot be null!

[Solved] java.lang.IllegalArgumentException: node to traverse cannot be null!

 

Issue Code:

[java]
Session session = null;
SessionFactory sessionFactory = null;
sessionFactory = HibernateConfig.getSessionFactory();
session = sessionFactory.openSession();
session.beginTransaction();
String queryString = "update ContentVO c set c.isImported = Y";
Query query = session.createQuery(queryString);
query.executeUpdate();
session.close();
sessionFactory.close();
[/java]

 

After the changing the code to below way issue got resolved:

[java]

Session session = null;
SessionFactory sessionFactory = null;
sessionFactory = HibernateConfig.getSessionFactory();
session = sessionFactory.openSession();
session.beginTransaction();
String queryString = "update couponzcorner.couponz set isImported = ‘N’";
Query query = session.createSQLQuery(queryString);
query.executeUpdate();
session.close();
sessionFactory.close();

[/java]

 

I tried updating using the java pojo mapped class, but later than I changed createSQLQuery method, which made the thing proper. Please post if you have resolved the similar kind of issues in any other way.

 

Leave a Reply