0 Replies Latest reply on Oct 23, 2009 2:23 PM by Bobby Lawrence

    EJB2.1 findByPrimaryKey and null argument

    Bobby Lawrence Newbie

      I'm trying to migrate an app from Weblogic to JBoss and I have a session bean managing entity beans.
      In my session bean, I have a method to lookup an entity bean by its String primary key.
      If the value is null, then JBoss throws an java.lang.IllegalArgumentException: findByPrimaryKey called with null argument.
      What gives with this?
      Why can't the EntityContainer just throw an ObjectNotFoundException?
      I find this very unsettling as this same code works fine under Weblogic and it properly throws an ObjectNotFoundException which my code properly catches and handles...