[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-6374) NPE after Creating Hibernate Configuration

Viacheslav Kabanovich (JIRA) jira-events at lists.jboss.org
Wed Jun 2 10:16:46 EDT 2010


    [ https://jira.jboss.org/browse/JBIDE-6374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12533628#action_12533628 ] 

Viacheslav Kabanovich commented on JBIDE-6374:
----------------------------------------------

NewConfigurationWizard creates new file in two stages. First it creates an empty file and then sets content to it. Of course, it is a legal way, but it creates a lot of problems for model update. The typical sequence is as follows. 1) Empty file is created. 2) It is loaded by model as unrecognized xml. 3) Content is set so fast after creation that modification stamp remains the same. 4) Model tries to update, but because it checks file modification stamp to avoid unnecessary update, it skips the file. 5) Editor fails because it gets unrecognized xml.
To avoid the issue, I suggest creating new file in one step, by overriding method WizardNewFileCreationPage.getInitialContents which is designated exactly for such purpose.
Next, editor should be modified to behave nicely when it receives unexpected input.
Finally, I will improve logic of XJob, that as I found in testing, in some cases failed to run tasks.

> NPE after Creating Hibernate Configuration
> ------------------------------------------
>
>                 Key: JBIDE-6374
>                 URL: https://jira.jboss.org/browse/JBIDE-6374
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Hibernate
>    Affects Versions: 3.1.1
>         Environment: JBDS 3.0.1 GA 80, Linux 64, JDK 1.6
>            Reporter: Jiri Peterka
>            Assignee: Viacheslav Kabanovich
>             Fix For: 3.1.x
>
>         Attachments: NPE-hibernate-configuration-editor.png, npe-hibernate-configuration-editor.txt
>
>
> ERROR: After trying to open configuration editor, it fails with NPE exception (see screenshots and log)
> REPRODUCIBILITY: LOW

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list