This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195700 - NullPointerException at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator.runImpl
Summary: NullPointerException at org.netbeans.modules.j2ee.persistence.wizard.fromdb.J...
Status: RESOLVED WORKSFORME
Alias: None
Product: webservices
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: All All
: P4 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-19 18:24 UTC by jocke
Modified: 2012-10-26 14:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 176827


Attachments
stacktrace (2.47 KB, text/plain)
2011-02-19 18:24 UTC, jocke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jocke 2011-02-19 18:24:48 UTC
This issue was reported manually by jocke.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build 201102180501)
VM: Java HotSpot(TM) 64-Bit Server VM, 19.1-b02, Java(TM) SE Runtime Environment, 1.6.0_24-b07
OS: Linux

User Comments:
jocke: added new resftul web service from database




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator.runImpl(JavaPersistenceGenerator.java:410)
   at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator.run(JavaPersistenceGenerator.java:376)
   at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator.generateBeans(JavaPersistenceGenerator.java:210)
   at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator.generateBeans(JavaPersistenceGenerator.java:178)
   at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator.generate(DatabaseResourceWizardIterator.java:275)
   at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator.access$000(DatabaseResourceWizardIterator.java:122)
Comment 1 jocke 2011-02-19 18:24:54 UTC
Created attachment 106189 [details]
stacktrace
Comment 2 Sergey Petrov 2011-02-21 15:02:52 UTC
please provide some more details, tried to generate rest from db on gf3.0.1 with some mysql datasource and have no nullpointer.
is it reproducible always or not, is it reproducible with new nb user dir or with some old/or imported from older nb. what settings are used in wizard - datasource, package, names etc. 

Also I see there are a lot more exceptions in log for different areas.
Comment 3 jocke 2011-02-22 07:36:05 UTC
I can't reproduce this now with latest build and a clean nb user dir
Comment 4 Sergey Petrov 2011-02-22 09:22:06 UTC
thanks, >P4 for now as it may be quite rare or not reproducible any more but it still will collect same reports if it's something new.
Comment 5 mariotti7777 2011-06-25 11:51:11 UTC
same problem here, tell me what info you need and i'll try to provide it :)
however follows the script to create db schema:


SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `epcsdb1` DEFAULT CHARACTER SET latin1 ;
USE `epcsdb1` ;

-- -----------------------------------------------------
-- Table `epcsdb1`.`user`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`user` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`user` (
  `id` INT NOT NULL AUTO_INCREMENT ,
  `name` VARCHAR(45) NULL ,
  `surname` VARCHAR(45) NULL ,
  `username` VARCHAR(45) NULL ,
  `password` VARCHAR(45) NULL ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `epcsdb1`.`team`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`team` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`team` (
  `id` INT NOT NULL AUTO_INCREMENT ,
  `type` VARCHAR(45) NULL ,
  `name` VARCHAR(45) NULL ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `epcsdb1`.`role`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`role` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`role` (
  `id` INT NOT NULL AUTO_INCREMENT ,
  `team_id` INT NOT NULL ,
  `user_id` INT NULL ,
  `name` VARCHAR(45) NULL ,
  `clearance` INT NULL ,
  PRIMARY KEY (`id`) ,
  INDEX `fk_role_group1` (`team_id` ASC) ,
  INDEX `fk_role_user1` (`user_id` ASC) ,
  CONSTRAINT `fk_role_group1`
    FOREIGN KEY (`team_id` )
    REFERENCES `epcsdb1`.`team` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_role_user1`
    FOREIGN KEY (`user_id` )
    REFERENCES `epcsdb1`.`user` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `epcsdb1`.`right`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`right` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`right` (
  `id` INT NOT NULL ,
  `role_id` INT NOT NULL ,
  `name` VARCHAR(45) NULL ,
  `value` TINYINT(1)  NULL ,
  PRIMARY KEY (`id`) ,
  INDEX `fk_right_role1` (`role_id` ASC) ,
  CONSTRAINT `fk_right_role1`
    FOREIGN KEY (`role_id` )
    REFERENCES `epcsdb1`.`role` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `epcsdb1`.`item`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`item` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`item` (
  `id` INT NOT NULL ,
  `name` VARCHAR(45) NULL ,
  `description` VARCHAR(255) NULL ,
  `type` VARCHAR(45) NULL ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `epcsdb1`.`image`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`image` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`image` (
  `user_id` INT NOT NULL ,
  `image` BLOB NULL ,
  PRIMARY KEY (`user_id`) ,
  INDEX `fk_image_user1` (`user_id` ASC) ,
  CONSTRAINT `fk_image_user1`
    FOREIGN KEY (`user_id` )
    REFERENCES `epcsdb1`.`user` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `epcsdb1`.`team_has_item`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `epcsdb1`.`team_has_item` ;

CREATE  TABLE IF NOT EXISTS `epcsdb1`.`team_has_item` (
  `team_id` INT NOT NULL ,
  `item_id` INT NOT NULL ,
  PRIMARY KEY (`team_id`, `item_id`) ,
  INDEX `fk_team_has_item_item1` (`item_id` ASC) ,
  INDEX `fk_team_has_item_team1` (`team_id` ASC) ,
  CONSTRAINT `fk_team_has_item_team1`
    FOREIGN KEY (`team_id` )
    REFERENCES `epcsdb1`.`team` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_team_has_item_item1`
    FOREIGN KEY (`item_id` )
    REFERENCES `epcsdb1`.`item` (`id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;




and the stacktrace:

java.lang.NullPointerException
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator.runImpl(JavaPersistenceGenerator.java:439)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator.run(JavaPersistenceGenerator.java:376)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator.generateBeans(JavaPersistenceGenerator.java:210)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator.generateBeans(JavaPersistenceGenerator.java:178)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:385)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.access$000(RelatedCMPWizard.java:87)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard$1.run(RelatedCMPWizard.java:294)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Comment 6 Marian Mirilovic 2012-10-26 14:29:16 UTC
Just one report long time ago