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 224005 - java.util.NoSuchElementException at java.util.ArrayList$Itr.next
Summary: java.util.NoSuchElementException at java.util.ArrayList$Itr.next
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 239734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-19 02:17 UTC by brettryan
Modified: 2015-03-03 14:58 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 196735


Attachments
stacktrace (1.70 KB, text/plain)
2012-12-19 02:17 UTC, brettryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brettryan 2012-12-19 02:17:53 UTC
This bug was originally marked as duplicate of bug 207767, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.3 Beta 2 (Build 201211062253)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_10-b18
OS: Mac OS X

User Comments:
brettryan: Trying to run Maven project in bundled tomcat.




Stacktrace: 
java.util.NoSuchElementException
   at java.util.ArrayList$Itr.next(ArrayList.java:794)
   at org.netbeans.modules.tomcat5.ide.StartTomcat.getJavaHome(StartTomcat.java:752)
   at org.netbeans.modules.tomcat5.ide.StartTomcat.access$900(StartTomcat.java:97)
   at org.netbeans.modules.tomcat5.ide.StartTomcat$StartRunnable.run(StartTomcat.java:490)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
   at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Comment 1 brettryan 2012-12-19 02:17:55 UTC
Created attachment 129523 [details]
stacktrace
Comment 2 brettryan 2012-12-19 02:22:35 UTC
Occurs when attempting to start tomcat from within the IDE.
Comment 3 brettryan 2012-12-19 02:30:02 UTC
Creating a new apache tomcat server entry with duplicated settings as that bundled solves the problem.
Comment 4 Petr Hejl 2012-12-19 10:15:41 UTC
JavaPlatform.getInstallFolders() returned empty collection. This is strange. Tomasi do you have any idea? Might it be Mac OS specific?

brettryan can you provide details about original tomcat configuration and the configuration which solved the problem?
Comment 5 brettryan 2012-12-19 10:39:34 UTC
Original tomcat configuration was what is installed with NetBeans 7.3 beta 2 (apache-tomcat-7.0.32). I inspected each element in the server configuration and duplicated it as a new server with all the same settings. i.e.

Tools > Servers > Add Server...

And switched back and forth between server configurations to set everything the same.

I did install with an upgrade of my user directory from a 7.2 installation. I wonder if this could have caused the problem. I can reinstall 7.3 B2 and not copy my configuration and see what happens.
Comment 6 Petr Hejl 2012-12-19 10:48:03 UTC
(In reply to comment #5)
> Original tomcat configuration was what is installed with NetBeans 7.3 beta 2
> (apache-tomcat-7.0.32). I inspected each element in the server configuration
> and duplicated it as a new server with all the same settings. i.e.
> 
> Tools > Servers > Add Server...
> 
> And switched back and forth between server configurations to set everything the
> same.
> 
> I did install with an upgrade of my user directory from a 7.2 installation. I
> wonder if this could have caused the problem. I can reinstall 7.3 B2 and not
> copy my configuration and see what happens.
Yep that would be great. Could you also check that preinstalled instance in your current setup still does not work? Thanks.
Comment 7 Tomas Zezula 2013-01-02 13:36:08 UTC
JavaPlatform.getInstallFolders().size() == 0 means that the platform is broken (for example the JDK was deleted).
Comment 8 Petr Hejl 2013-01-08 13:45:38 UTC
(In reply to comment #7)
> JavaPlatform.getInstallFolders().size() == 0 means that the platform is broken
> (for example the JDK was deleted).

brettryan, might this be your case? Thanks.
Comment 9 brettryan 2013-03-26 13:19:04 UTC
Okay, I know the cause.

Steps to reproduce:

  1. Install JDK and NB as normal with Tomcat
  2. Validate configuration by creating web app and running in Tomcat
  3. Close IDE, install newer JDK.
  4. Start NetBeans
  5. Confirm that running existing project causes this failure.

You will now find two JDK's with the same name in Java Platforms (JDK 1.7), one being defaulted.

Do not delete the bad one as I want to show something else.

  1. Close platforms
  2. View properties of Tomcat instance
  3. Under "Platform" select the default JDK
  4. Confirm tomcat works correctly.
  5. Close IDE
  6. Restart IDE
  7. Tomcat exhibits error again.

So it seems also that the tomcat settings take the first JDK and not the default one.

I believe this could be fixed by tomcat always defaulting to the default JDK if not specified, furthermore if I set it it should be persisted, though this may be because both JDK's had the same name.
Comment 10 Petr Hejl 2013-07-17 07:37:55 UTC
Fixed in web-main b4ed10d4d754.
Comment 11 Quality Engineering 2013-07-18 02:37:08 UTC
Integrated into 'main-silver', will be available in build *201307172300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b4ed10d4d754
User: Petr Hejl <phejl@netbeans.org>
Log: #224005 - java.util.NoSuchElementException at java.util.ArrayList$Itr.next
Comment 12 Petr Hejl 2015-03-03 14:58:22 UTC
*** Bug 239734 has been marked as a duplicate of this bug. ***