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 126949 - WS Policy configuration NullPointerException when enabling Security
Summary: WS Policy configuration NullPointerException when enabling Security
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: WSIT (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Grebac
URL:
Keywords:
: 126645 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-07 21:36 UTC by Noel Ang
Modified: 2008-04-09 17:27 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Comp App Project and JBI project test case (30.77 KB, application/octet-stream)
2008-02-07 21:37 UTC, Noel Ang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noel Ang 2008-02-07 21:36:49 UTC
This issue occurs with:
- latest Sierra build from deadlock.netbeans.org, #760.
- latest Sierra milestone, which is #6, which is build #436

Here's the error:

java.lang.NullPointerException
	at
org.netbeans.modules.websvc.wsitconf.ui.service.profiles.UsernameAuthenticationProfile.isServiceDefaultSetupUsed(UsernameAuthenticationProfile.java:134)
	at
org.netbeans.modules.websvc.wsitconf.wsdlmodelext.ProfilesModelHelper.isServiceDefaultSetupUsed(ProfilesModelHelper.java:416)
	at org.netbeans.modules.websvc.wsitconf.ui.service.ServicePanel.setValue(ServicePanel.java:364)
	at org.netbeans.modules.xml.multiview.ui.SectionInnerPanel$ComboBoxActionListener.doSetValue(SectionInnerPanel.java:604)
	at org.netbeans.modules.xml.multiview.ui.SectionInnerPanel$FlushActionListener.actionPerformed(SectionInnerPanel.java:579)
	at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1197)
	at javax.swing.JComboBox.setSelectedItem(JComboBox.java:561)
	at org.netbeans.modules.websvc.wsitconf.ui.service.ServicePanel.setValue(ServicePanel.java:311)
	at org.netbeans.modules.xml.multiview.ui.SectionInnerPanel$CheckBoxActionListener.doSetValue(SectionInnerPanel.java:621)
	at org.netbeans.modules.xml.multiview.ui.SectionInnerPanel$FlushActionListener.actionPerformed(SectionInnerPanel.java:579)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:269)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
	at java.awt.Component.processMouseEvent(Component.java:5517)


Steps to reproduce the problem:

1. Open the attached Comp App project in Netbeans.
2. Choose to "Clean Application Configuration"
3. Choose to "Edit Application Configuration"
4. In the Assembly Editor, create a new SOAP WSDL Port.
5. Connect the new Port to the BPEL JBI Module, consumer endpoint to provider endpoint.
6. Choose to Edit Web Service Attributes (Service configuration) for the new Port.
7. The WS Policy Attachment dialog will appear.  Select the 'Secure Service' checkbox.

Tried earlier (thru January 2008) NB 6.1 nightly builds randomly, none of the ones tried work.
Comment 1 Noel Ang 2008-02-07 21:37:57 UTC
Created attachment 56287 [details]
Comp App Project and JBI project test case
Comment 2 Tientien Li 2008-02-11 21:07:11 UTC
Martin,

Can you take a look at this ticket filed by Noel aginst CASA and see how it can be fixed? 

    http://www.netbeans.org/issues/show_bug.cgi?id=126949

java.lang.NullPointerException
 at org.netbeans.modules.websvc.wsitconf.ui.service.profiles.UsernameAuthenticationProfile.isServiceDefaultSetupUsed
(UsernameAuthenticationProfile.java:134)
 at org.netbeans.modules.websvc.wsitconf.wsdlmodelext.ProfilesModelHelper.isServiceDefaultSetupUsed
(ProfilesModelHelper.java:416)
 ....

The error was caused by the fact that a check for tomcat project was removed last month. The code at line 134 in 
UsernameAuthenticationProfile.java generates a NPE when running with CompApp projects:

  if ((Util.getDefaultPassword(p).equals(storePasswd)) &&
     (Util.getStoreLocation(p, false, false).equals(storeLoc))) {
          return true;
  }

The NPE is caused by the test Util.getStoreLocation(p, false, false) returning null. Please let us know if you think 
anything change or enhancement in the CASA code is needed to fix this issue.

Thanks,
Comment 3 Martin Grebac 2008-02-15 16:17:37 UTC
Sorry, I missed your comments. Yes, I forgot about CASA usage when fixing different issue. I'll think about what would
be best way to fix this.
Comment 4 Tientien Li 2008-02-19 21:37:41 UTC
*** Issue 126645 has been marked as a duplicate of this issue. ***
Comment 5 Sherry Weng 2008-02-20 00:08:05 UTC
Adding myself to the CC list
Comment 6 Martin Grebac 2008-02-21 21:40:44 UTC
Should be fixed in trunk.
Comment 7 jlautz 2008-04-09 17:27:38 UTC
Verified fixed with 
Product Version: NetBeans IDE Dev (Build 200804040802) - Java CAPS Enabled
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: SunOS version 5.10 running on x86; ISO646-US; en (nb)
Userdir: /Users/lautz/sierrabuilds/JavaCAPS20080406/.netbeans/caps