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.

View | Details | Raw Unified | Return to bug 165819
Collapse All | Expand All

(-)a/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/JBDeploymentManager.java (-3 / +3 lines)
Lines 173-183 Link Here
173
            Properties env = new Properties();
173
            Properties env = new Properties();
174
174
175
            // Sets the jboss naming environment
175
            // Sets the jboss naming environment
176
            String jnpPort = JBPluginUtils.getJnpPort(ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR));
176
            String jnpPort = Integer.toString(
177
            jnpPort  = ( jnpPort != null && jnpPort.trim().length() > 0 ) ? jnpPort.trim() : "1099";
177
                    JBPluginUtils.getJnpPortNumber(ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR)));
178
178
179
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
179
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
180
            env.put(Context.PROVIDER_URL, "jnp://localhost"+ ( jnpPort.length()  > 0 ? (":"  + jnpPort)  : "") );
180
            env.put(Context.PROVIDER_URL, "jnp://localhost"+ ":"  + jnpPort);
181
            env.put(Context.OBJECT_FACTORIES, "org.jboss.naming");
181
            env.put(Context.OBJECT_FACTORIES, "org.jboss.naming");
182
            env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
182
            env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
183
            env.put("jnp.disableDiscovery", Boolean.TRUE);
183
            env.put("jnp.disableDiscovery", Boolean.TRUE);
(-)a/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStopRunnable.java (-3 / +16 lines)
Lines 56-61 Link Here
56
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
56
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
57
import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager;
57
import org.netbeans.modules.j2ee.jboss4.JBDeploymentManager;
58
import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginProperties;
58
import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginProperties;
59
import org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils;
59
import org.netbeans.modules.j2ee.jboss4.util.JBProperties;
60
import org.netbeans.modules.j2ee.jboss4.util.JBProperties;
60
import org.openide.execution.NbProcessDescriptor;
61
import org.openide.execution.NbProcessDescriptor;
61
import org.openide.filesystems.FileObject;
62
import org.openide.filesystems.FileObject;
Lines 124-131 Link Here
124
        }
125
        }
125
        
126
        
126
        JBProperties properties = dm.getProperties();
127
        JBProperties properties = dm.getProperties();
127
        StringBuilder credentialsParams = new StringBuilder(32);
128
        StringBuilder additionalParams = new StringBuilder(32);
128
        credentialsParams.append(" -u ").append(properties.getUsername()).append(" -p ").append(properties.getPassword()); // NOI18N
129
        int jnpPort = JBPluginUtils.getJnpPortNumber(ip.getProperty(JBPluginProperties.PROPERTY_SERVER_DIR));  
130
        if (dm.getProperties().getServerVersion().compareTo(JBPluginUtils.JBOSS_6_0_0) < 0) {
131
            additionalParams.append(" -s jnp://localhost:").append(jnpPort); // NOI18N
132
        } else {
133
            // FIXME changed for JBoss 6
134
            // see http://community.jboss.org/message/546904
135
            // and http://community.jboss.org/wiki/StartStopJBoss
136
        }
137
        
138
        additionalParams.append(" -u ").append(properties.getUsername()); // NOI18N
139
        additionalParams.append(" -p ").append(properties.getPassword()); // NOI18N
140
        
129
        // Currently there is a problem stopping JBoss when Profiler agent is loaded.
141
        // Currently there is a problem stopping JBoss when Profiler agent is loaded.
130
        // As a workaround for now, --halt parameter has to be used for stopping the server.
142
        // As a workaround for now, --halt parameter has to be used for stopping the server.
131
//        NbProcessDescriptor pd = (startServer.getMode() == JBStartServer.MODE.PROFILE ?
143
//        NbProcessDescriptor pd = (startServer.getMode() == JBStartServer.MODE.PROFILE ?
Lines 134-140 Link Here
134
146
135
        /* 2008-09-10 The usage of --halt doesn't solve the problem on Windows; it even creates another problem
147
        /* 2008-09-10 The usage of --halt doesn't solve the problem on Windows; it even creates another problem
136
                        of NB Profiler not being notified about the fact that the server was stopped */
148
                        of NB Profiler not being notified about the fact that the server was stopped */
137
        NbProcessDescriptor pd = new NbProcessDescriptor(serverStopFileName, "--shutdown " + credentialsParams); // NOI18N
149
        NbProcessDescriptor pd = new NbProcessDescriptor(
150
                serverStopFileName, "--shutdown " + additionalParams); // NOI18N
138
151
139
        Process stoppingProcess = null;
152
        Process stoppingProcess = null;
140
        try {
153
        try {
(-)a/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/ui/JBPluginUtils.java (-7 / +21 lines)
Lines 100-106 Link Here
100
100
101
    public static final String CLIENT = "client" + File.separator;
101
    public static final String CLIENT = "client" + File.separator;
102
102
103
    public  static final String COMMON = "common" + File.separator;
103
    public static final String COMMON = "common" + File.separator;
104
104
105
105
106
    // For JBoss 5.0 under JBOSS_ROOT_DIR/lib
106
    // For JBoss 5.0 under JBOSS_ROOT_DIR/lib
Lines 180-198 Link Here
180
    private static List<String> domainRequirements6x;
180
    private static List<String> domainRequirements6x;
181
181
182
    private static synchronized List<String> getDomainRequirements6x() {
182
    private static synchronized List<String> getDomainRequirements6x() {
183
        if (domainRequirements5x == null) {
183
        if (domainRequirements6x == null) {
184
            domainRequirements5x = new ArrayList<String>(11);
184
            domainRequirements6x = new ArrayList<String>(11);
185
            Collections.addAll(domainRequirements5x,
185
            Collections.addAll(domainRequirements6x,
186
                    "conf", // NOI18N
186
                    "conf", // NOI18N
187
                    "deploy", // NOI18N
187
                    "deploy", // NOI18N
188
                    "deployers", // NOI18N
188
                    "deployers", // NOI18N
189
                    "lib", // NOI18N
189
                    "lib", // NOI18N
190
                    "conf/jboss-service.xml", // NOI18N
190
                    "conf/jboss-service.xml", // NOI18N
191
                    "conf/bootstrap.xml", // NOI18N
191
                    "conf/bootstrap.xml", // NOI18N
192
                    "deploy/hdscanner-jboss-beans.xml"   // NOI18N
192
                    "deploy/hdscanner-jboss-beans.xml" // NOI18N
193
                    );
193
                    );
194
        }
194
        }
195
        return domainRequirements5x;
195
        return domainRequirements6x;
196
    }
196
    }
197
197
198
    //--------------- checking for possible server directory -------------
198
    //--------------- checking for possible server directory -------------
Lines 498-505 Link Here
498
        return defaultPort;
498
        return defaultPort;
499
    }
499
    }
500
500
501
    public static int getJnpPortNumber(String domainDir) {
502
        String jnpPort = getJnpPort(domainDir);
503
        if(jnpPort != null) {
504
            jnpPort = jnpPort.trim();
505
            if (jnpPort.length() > 0) {
506
                try {
507
                    return Integer.parseInt(jnpPort);
508
                } catch(NumberFormatException e) {
509
                    // pass through to default
510
                }
511
            }
512
        }  
513
        return 1099;
514
    }
501
515
502
    public static String getJnpPort(String domainDir){
516
    public static String getJnpPort(String domainDir) {
503
517
504
        String serviceXml = domainDir+File.separator+"conf"+File.separator+"jboss-service.xml"; //NOI18N
518
        String serviceXml = domainDir+File.separator+"conf"+File.separator+"jboss-service.xml"; //NOI18N
505
        File xmlFile = new File(serviceXml);
519
        File xmlFile = new File(serviceXml);

Return to bug 165819