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 270041 - UnsupportedOperationException: Modification of [/home/martin/NetBeansProjects/MyModularApp/src/mymodular.app/classes, classpath/compile] is not supported
Summary: UnsupportedOperationException: Modification of [/home/martin/NetBeansProjects...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-10 11:24 UTC by Martin Balin
Modified: 2017-03-14 13:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 228361


Attachments
stacktrace (4.03 KB, text/plain)
2017-03-10 11:24 UTC, Martin Balin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Balin 2017-03-10 11:24:50 UTC
Build: NetBeans IDE Dev (Build 201703100002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.121-b13, Java(TM) SE Runtime Environment, 1.8.0_121-b13
OS: Linux

User Comments:
mbalin: Create multimodule app.
Add module or two
add package to module, e.g. com.martin.mymodule.app
Add JFrame form to package
Exception thrown.




Stacktrace: 
java.lang.UnsupportedOperationException: Modification of [/home/martin/NetBeansProjects/MyModularApp/src/mymodular.app/classes, classpath/compile] is not supported
   at org.netbeans.modules.java.j2semodule.J2SEModularProject$2.getClassPathProperty(J2SEModularProject.java:219)
   at org.netbeans.modules.java.api.common.classpath.ClassPathModifier.addLibraries(ClassPathModifier.java:183)
   at org.netbeans.spi.java.project.classpath.ProjectClassPathModifierImplementation$Accessor.addLibraries(ProjectClassPathModifierImplementation.java:426)
   at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.addLibraries(ProjectClassPathModifier.java:97)
   at org.netbeans.modules.nbform.project.ClassSourceResolver$LibraryEntry.addToProjectClassPath(ClassSourceResolver.java:227)
   at org.netbeans.modules.form.project.ClassSource.addToProjectClassPath(ClassSource.java:114)
Comment 1 Martin Balin 2017-03-10 11:24:53 UTC
Created attachment 163809 [details]
stacktrace
Comment 2 Martin Balin 2017-03-10 11:36:14 UTC
The formeditor has generated this code: 

// <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 300, Short.MAX_VALUE)
        );

=> org.jdesktop.layout.GroupLayout(getContentPane()); is wrong.

It happened when module-info.java did not require java.desktop module. After adding this dependency infor module-info newly created form files are correct.