Mantis - Resin
Viewing Issue Advanced Details
3936 major always 03-10-10 02:12 04-07-11 09:48
walec51  
alex  
normal  
closed 4.0.1  
fixed  
none    
none 4.0.16  
0003936: Fighting to make the Netbeans plugin work
Hello,

I've spend almost the entire day trying to make the resin-netbeans-4.0.1 plugin work. I need to do the following steps to just make it install:

In the Info/info.xml you must specify the downloadsize arrtibute, adding the XML declarations would also be nice:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE module PUBLIC "-//NetBeans//DTD Autoupdate Module Info 2.5//EN" "http://www.netbeans.org/dtds/autoupdate-info-2_5.dtd"> [^]
<module codenamebase="com.caucho.netbeans"
        distribution=""
    downloadsize="0"
    homepage="http://caucho.com" [^]
    license="GPL"
    needsrestart="false"
    releasedate="2008/01/05">
...

without this you'll get the NumberFormat exception while trying to add the plugin.

After install there is also a problem with loading the plugin. You get this exception:

java.io.IOException: Autoloads cannot specify enablement
    at org.netbeans.core.startup.ModuleList.sanityCheckStatus(ModuleList.java:608)
    at org.netbeans.core.startup.ModuleList.readStatus(ModuleList.java:721)
    at org.netbeans.core.startup.ModuleList.access$2700(ModuleList.java:117)
    at org.netbeans.core.startup.ModuleList$ReadInitial.run(ModuleList.java:1763)
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:122)
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:539)
    at org.netbeans.core.startup.ModuleList.readInitial(ModuleList.java:171)
    at org.netbeans.core.startup.ModuleSystem.readList(ModuleSystem.java:262)
    at org.netbeans.core.startup.Main.getModuleSystem(Main.java:167)
    at org.netbeans.core.startup.Main.start(Main.java:309)
    at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111)



In order to overcome this you have to change the autoload param to false.
After this change I got an exception about some naming convention being wrong.



java.io.IOException: Code name mismatch: resin.netbeans.plugin vs. com.caucho.netbeans
    at org.netbeans.core.startup.ModuleList$ReadInitial.run(ModuleList.java:1787)
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:122)
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:539)
    at org.netbeans.core.startup.ModuleList.readInitial(ModuleList.java:171)
    at org.netbeans.core.startup.ModuleSystem.readList(ModuleSystem.java:262)
    at org.netbeans.core.startup.Main.getModuleSystem(Main.java:167)
    at org.netbeans.core.startup.Main.start(Main.java:309)
    at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111)




So I had to change the names of the conf xml and jar file to com-caucho-netbeans.xml (or jar).

My conf look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//NetBeans//DTD Module Status 1.0//EN"
                        "http://www.netbeans.org/dtds/module-status-1_0.dtd"> [^]
<module name="com.caucho.netbeans">
    <param name="autoload">false</param>
    <param name="eager">false</param>
    <param name="enabled">true</param>
    <param name="jar">modules/com-caucho-netbeans-plugin.jar</param>
    <param name="reloadable">true</param>
    <param name="specversion">1.0</param>
</module>

After this I got the:

java.lang.ClassNotFoundException: javax.enterprise.deploy.spi.factories.DeploymentFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:259)

As I looked I found that there was a mistage in the MANIFEST.MF file of the plugins jar.
this OpenIDE-Module-Dependencies: ... should be OpenIDE-Module-Module-Dependencies:

I also had to add some missing dependencies do my final file looks like this:

Manifest-Version: 1.0

Ant-Version: Apache Ant 1.7.0

Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.)

Implementation-Vendor: Caucho Technology, Inc.

Implementation-Version: 3.1.0

AutoUpdate-Show-In-Client: false

OpenIDE-Module: com.caucho.netbeans

OpenIDE-Module-Module-Dependencies: org.netbeans.modules.j2eeapis/1,
 org.netbeans.modules.j2ee.common/1, org.netbeans.modules.j2eeserver/
 4, org.netbeans.modules.j2ee.dd/1, org.jdesktop.layout/1, org.openi
 de.actions > 6.2, org.openide.awt > 6.2, org.openide.dialogs > 6.2, o
 rg.openide.execution > 1.3, org.openide.filesystems > 6.2, org.openid
 e.io, org.openide.loaders, org.openide.modules > 6.2, org.openide.nod
 es > 6.2, org.openide.text > 6.2, org.openide.util > 6.2, org.openide
 .windows > 6.2, org.netbeans.modules.project.libraries/1, org.netbe
 ans.modules.java.platform/1

OpenIDE-Module-Display-Category: "Web &amp; Java EE"

OpenIDE-Module-Implementation-Version: 080106

OpenIDE-Module-Layer: com/caucho/netbeans/resources/layer.xml

OpenIDE-Module-Long-Description: Resin Application Server

OpenIDE-Module-Localizing-Bundle: com/caucho/netbeans/resources/Bundle

 .properties

OpenIDE-Module-Module-Name: Resin Application Server

OpenIDE-Module-Public-Packages: -

OpenIDE-Module-Requires: org.openide.modules.ModuleFormat1

OpenIDE-Module-Short-Description: Resin

OpenIDE-Module-Specification-Version: 1.0

The plugin got finally installed. But the I tried to use the "Add Server" option I got:

java.lang.NullPointerException
    at java.util.Arrays.sort(Arrays.java:1078)
    at com.caucho.netbeans.ide.AddInstanceIterator.findResinHome(AddInstanceIterator.java:135)
    at com.caucho.netbeans.ide.AddInstanceIterator.findResinHome(AddInstanceIterator.java:107)
    at com.caucho.netbeans.ide.AddInstanceIterator.<init>(AddInstanceIterator.java:73)
    at com.caucho.netbeans.ide.ResinOptionalFactory.getAddInstanceIterator(ResinOptionalFactory.java:76)
    at org.netbeans.modules.j2ee.deployment.impl.bridge.BridgingServerWizardProvider.getInstantiatingIterator(BridgingServerWizardProvider.java:71)
    at org.netbeans.modules.server.ui.wizard.ServerWizardVisual$WizardListModel.<init>(ServerWizardVisual.java:346)
    at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.initComponents(ServerWizardVisual.java:262)
    at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.<init>(ServerWizardVisual.java:86)
    at org.netbeans.modules.server.ui.wizard.ServerWizardPanel.getComponent(ServerWizardPanel.java:68)
    at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard$AddServerInstanceWizardIterator.initialize(AddServerInstanceWizard.java:354)
    at org.openide.WizardDescriptor.callInitialize(WizardDescriptor.java:1480)
    at org.openide.WizardDescriptor.<init>(WizardDescriptor.java:481)
    at org.openide.WizardDescriptor.<init>(WizardDescriptor.java:490)
    at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard.<init>(AddServerInstanceWizard.java:116)




An this is becouse the plugin assumes that resin is in one of the following directories:




private String findResinHome()
  {
    String resinHome;
    
    resinHome = findResinHome(System.getProperty("user.home"));
    if (resinHome != null)
      return resinHome;
    
    resinHome = findResinHome(System.getProperty("user.home") + "/ws");
    if (resinHome != null)
      return resinHome;
    
    resinHome = findResinHome("/usr/local/share");
    if (resinHome != null)
      return resinHome;
    
    resinHome = findResinHome("/usr/local");
    if (resinHome != null)
      return resinHome;
    
    resinHome = findResinHome("/opt");
    if (resinHome != null)
      return resinHome;
    
    return null;
  }



Maybe is should also look in the path set in the RESIN_HOME env varialbe ?

Even after coping resin to the right dir I still got null ptr exp becouse some missing lib/resin-util.jar was missing. After working around this I could create a Resin based project but couldn't deploy it using Netbeans.

Hope this helps you in making the Netbeans plugin better.




Notes
(0005176)
alex   
04-07-11 09:48   
updated plugin is available at http://www.caucho.com/netbeans/ [^]