View | Details | Raw Unified | Return to bug 160220 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.properties (+7 lines)
Lines 11-16 Link Here
11
websphere.6.server.description=Publishes and runs J2EE 1.4 modules on a local server. \
11
websphere.6.server.description=Publishes and runs J2EE 1.4 modules on a local server. \
12
Provides basic server functionality
12
Provides basic server functionality
13
13
14
websphere.6.1.runtime.name=IBM WebSphere v6.1
15
websphere.6.1.runtime.description=Publishes and runs J2EE 1.4 modules on a local server. \
16
Provides basic server functionality
17
websphere.6.1.server.name=IBM WebSphere v6.1
18
websphere.6.1.server.description=Publishes and runs J2EE 1.4 modules on a local server. \
19
Provides basic server functionality
20
14
wasHome=IBM WebSphere Installation Directory:
21
wasHome=IBM WebSphere Installation Directory:
15
port=Port:
22
port=Port:
16
wasProfile=Server Profile Directory:
23
wasProfile=Server Profile Directory:
(-)plugin.xml (-1 / +3 lines)
Lines 75-80 Link Here
75
   <extension point="org.eclipse.jst.server.generic.core.serverdefinition">
75
   <extension point="org.eclipse.jst.server.generic.core.serverdefinition">
76
		<serverdefinition id="org.eclipse.jst.server.generic.runtime.websphere.6" definitionfile="/serverdef/websphere.6.serverdef">
76
		<serverdefinition id="org.eclipse.jst.server.generic.runtime.websphere.6" definitionfile="/serverdef/websphere.6.serverdef">
77
		</serverdefinition>
77
		</serverdefinition>
78
		<serverdefinition id="org.eclipse.jst.server.generic.runtime.websphere.6.1" definitionfile="/serverdef/websphere.6.1.serverdef">
79
		</serverdefinition>
78
   </extension>
80
   </extension>
79
81
80
   <extension point="org.eclipse.jst.server.generic.core.genericpublisher">
82
   <extension point="org.eclipse.jst.server.generic.core.genericpublisher">
Lines 148-151 Link Here
148
      <type class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
150
      <type class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
149
    </adapter>
151
    </adapter>
150
  </extension>
152
  </extension>
151
</plugin>
153
</plugin>
(-)serverdef/scripts/websphere.6.1.xml (+154 lines)
Added Link Here
1
<project name="deployextension"  default="deploy.j2ee.web"  basedir=".">
2
3
	<property name="was.home" value="${wasHome}"/>
4
    <property name="module.working.dir" value="${project.working.dir}/${project.name}"></property>
5
	<path id="toolpath">
6
		<fileset dir="${was.home}/lib">
7
			<include name="*.jar" />
8
		</fileset>
9
		<fileset dir="${was.home}/plugins">
10
			<include name="*com.ibm.ws.runtime_6.1.0.jar" />
11
		</fileset>
12
		<pathelement path="${was.home}/lib/properties" />
13
		<pathelement path="${was.home}/optionalLibraries/jython.jar" />
14
	</path>
15
16
	<taskdef classpathref="toolpath" name="wsadmin" classname="com.ibm.websphere.ant.tasks.WsAdmin" />
17
	<taskdef classpathref="toolpath" name="wsejbdeploy" classname="com.ibm.websphere.ant.tasks.WsEjbDeploy" />	
18
	<taskdef classpathref="toolpath" name="wsinstallapp" classname="com.ibm.websphere.ant.tasks.InstallApplication" />	
19
20
	<target name="deploy.j2ee.web">
21
		<echo message="Module Working Day  ${module.working.dir} Project Working Dir=${project.working.dir} Message Dir=${module.dir} Module Name ${module.name}"></echo>
22
		<jar destfile="${project.working.dir}/${module.name}.war"> 
23
			<zipfileset dir="${module.working.dir}">
24
				<include name="**/*.*"/>
25
				<exclude name="**/*.war"/>
26
			</zipfileset>
27
		</jar>
28
		<wsadmin  
29
			washome="${was.home}" 	
30
			properties="${wasProfile}/properties/wsadmin.properties" 
31
			command="$AdminApp uninstall ${module.name}" 
32
			failonerror="false">
33
		</wsadmin>
34
	    <wsadmin  
35
			washome="${was.home}" 				
36
			properties="${wasProfile}/properties/wsadmin.properties" 
37
			command="$AdminApp install ${project.working.dir}/${module.name}.war {-appname ${module.name} -contextroot  ${contextRoot} -usedefaultbindings}" 
38
			failonerror="true">
39
		</wsadmin>
40
	    <wsadmin  
41
		  washome="${was.home}" 
42
		  properties="${wasProfile}/properties/wsadmin.properties" 
43
		  command="$AdminControl invoke [$AdminControl queryNames type=ApplicationManager,*] startApplication ${module.name}" 
44
		  failonerror="true">
45
	    </wsadmin>			
46
	</target>
47
	
48
	<target name="deploy.j2ee.ejb">
49
		<jar destfile="${project.working.dir}/${module.name}.jar"> 
50
			<zipfileset dir="${module.dir}">
51
	        	<include name="**/*.*"/>
52
	       		<exclude name="**/*.java"/>
53
			</zipfileset>
54
		</jar>
55
		<wsejbdeploy 
56
				inputJar="${project.working.dir}/${module.name}.jar" 
57
				wasHome="${was.home}" 
58
				washome="${was.home}" 
59
				classpathref="toolpath"
60
				outputJar="${project.working.dir}/${module.name}-was.jar" 
61
				codegen="true " 
62
				keepGenerated="true" 
63
				quiet="false" 
64
				noValidate="true" 
65
				noWarnings="false" 
66
				noInform="false" 
67
				compatible35="false" 
68
				failonerror="true" 
69
				trace="true" 
70
				jvmMaxMemory="256M" />
71
	
72
			<wsadmin  
73
				washome="${was.home}" 
74
				properties="${wasProfile}/properties/wsadmin.properties" 
75
				command="$AdminApp uninstall ${module.name}" 
76
				failonerror="false">
77
			</wsadmin>
78
79
		    <wsadmin  
80
				washome="${was.home}" 				
81
				properties="${wasProfile}/properties/wsadmin.properties" 
82
				command="$AdminApp install ${project.working.dir}/${module.name}.jar {-appname ${module.name} -usedefaultbindings}" 
83
				failonerror="true">
84
			</wsadmin>
85
86
			<wsadmin  
87
			  washome="${was.home}" 
88
			  properties="${wasProfile}/properties/wsadmin.properties" 
89
			  command="$AdminControl invoke [$AdminControl queryNames type=ApplicationManager,*] startApplication ${module.name}" 
90
			  failonerror="true">
91
		    </wsadmin>	
92
	</target>
93
	
94
	<target name="deploy.j2ee.ear">
95
		<jar destfile="${project.working.dir}/${module.name}.ear"> 
96
			<zipfileset dir="${module.dir}">
97
	        	<include name="**/*.*"/>
98
	       		<exclude name="**/*.java"/>
99
			</zipfileset>
100
		</jar>
101
102
		<wsadmin  
103
					washome="${was.home}" 
104
					properties="${wasProfile}/properties/wsadmin.properties" 
105
					command="$AdminApp uninstall ${module.name}" 
106
					failonerror="false">
107
		</wsadmin>
108
109
		<wsadmin  
110
					washome="${was.home}" 				
111
					properties="${wasProfile}/properties/wsadmin.properties" 
112
					command="$AdminApp install ${project.working.dir}/${module.name}.ear {-appname ${module.name} -deployejb -usedefaultbindings}" 
113
					failonerror="true">
114
		</wsadmin>
115
		<wsadmin  
116
				  washome="${was.home}" 
117
				  properties="${wasProfile}/properties/wsadmin.properties" 
118
				  command="$AdminControl invoke [$AdminControl queryNames type=ApplicationManager,*] startApplication ${module.name}" 
119
				  failonerror="true">
120
		 </wsadmin>	
121
		
122
	</target>	
123
	
124
	<target name="undeploy.j2ee.web">
125
		
126
		<wsadmin  
127
			washome="${was.home}" 
128
			
129
			properties="${wasProfile}/properties/wsadmin.properties" 
130
			command="$AdminApp uninstall ${module.name}" 
131
			failonerror="false">
132
		</wsadmin>
133
	</target>
134
	<target name="undeploy.j2ee.ejb">
135
		<wsadmin  
136
			washome="${was.home}" 
137
			
138
			properties="${wasProfile}/properties/wsadmin.properties" 
139
			command="$AdminApp uninstall ${module.name}" 
140
			failonerror="false">
141
		</wsadmin>
142
	</target>	
143
	
144
	<target name="undeploy.j2ee.ear">
145
		<wsadmin  
146
			washome="${was.home}" 
147
			
148
			properties="${wasProfile}/properties/wsadmin.properties" 
149
			command="$AdminApp uninstall ${module.name}" 
150
			failonerror="false">
151
		</wsadmin>
152
	</target>	
153
154
</project>
(-)serverdef/websphere.6.1.serverdef (+171 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<tns:ServerRuntime
3
	xmlns:tns="http://eclipse.org/jst/server/generic/ServerTypeDefinition"
4
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
	xsi:schemaLocation="http://eclipse.org/jst/server/generic/ServerTypeDefinition ServerTypeDefinitionSchema.xsd "
6
	name="IBM WebSphere 6.1" version="v6.1">
7
	<property id="wasHome"
8
		label="%wasHome"
9
		type="directory"
10
		context="runtime"
11
		default="/your_server_root/was-6.1" />
12
13
	<property id="port"
14
		label="%port"
15
		type="string"
16
		context="server"
17
		default="9080" />
18
19
	<property id="wasProfile"
20
		label="%wasProfile"
21
		type="directory"
22
		context="server"
23
		default="/your_server_root/was-6.1/profiles/default" />
24
<!--
25
	<property id="wasCell"
26
		label="%wasCell"
27
		type="string"
28
		context="server"
29
		default="[cell]" />
30
31
	<property id="wasNode"
32
		label="%wasNode"
33
		type="string"
34
		context="server"
35
		default="[Node]" />
36
-->		
37
	<property id="wasServer"
38
		label="%wasServer"
39
		type="string"
40
		context="server"
41
		default="server1" />
42
43
	<port>
44
		<no>${port}</no>
45
		<name>Http</name>
46
		<protocol>http</protocol>
47
	</port>
48
49
	<module>
50
		<type>jst.web</type>
51
		<publishDir>${wasHome}</publishDir>
52
		<publisherReference>org.eclipse.jst.server.generic.websphere.antpublisher</publisherReference>
53
	</module>
54
	<module>
55
		<type>jst.ejb</type>
56
		<publishDir>${wasHome}</publishDir>
57
		<publisherReference>org.eclipse.jst.server.generic.websphere.antpublisher</publisherReference>
58
	</module>
59
	<module>
60
		<type>jst.ear</type>
61
		<publishDir>${wasHome}</publishDir>
62
		<publisherReference>org.eclipse.jst.server.generic.websphere.antpublisher</publisherReference>
63
	</module>
64
	<module>
65
		<type>jst.connector</type>
66
		<publishDir>${wasHome}</publishDir>
67
		<publisherReference>org.eclipse.jst.server.generic.websphere.antpublisher</publisherReference>
68
	</module>
69
	<project>
70
		<classpathReference>was.project</classpathReference>
71
	</project>
72
73
	<start>
74
		<external>${wasProfile}/bin/startServer.bat "${wasServer}"</external>
75
		<workingDirectory>${wasProfile}</workingDirectory>
76
		<debugPort>${debugPort}</debugPort>
77
	</start>	
78
79
	<stop>
80
		<external>${wasProfile}/bin/stopServer.bat "${wasServer}"</external>
81
		<workingDirectory>${wasProfile}</workingDirectory>
82
	</stop>
83
		
84
	<publisher id="org.eclipse.jst.server.generic.antpublisher">
85
		<publisherdata>
86
			<dataname>build.file</dataname>
87
			<datavalue>/serverdef/scripts/websphere.6.1.xml</datavalue>
88
		</publisherdata>
89
		<publisherdata>
90
			<dataname>target.publish.jst.web</dataname>
91
			<datavalue>deploy.j2ee.web</datavalue>
92
		</publisherdata>
93
		<publisherdata>
94
			<dataname>target.publish.jst.ejb</dataname>
95
			<datavalue>deploy.j2ee.ejb</datavalue>
96
		</publisherdata>
97
		<publisherdata>
98
			<dataname>target.unpublish.jst.web</dataname>
99
			<datavalue>undeploy.j2ee.web</datavalue>
100
		</publisherdata>
101
		<publisherdata>
102
			<dataname>target.unpublish.jst.ejb</dataname>
103
			<datavalue>undeploy.j2ee.ejb</datavalue>
104
		</publisherdata>
105
		<publisherdata>
106
			<dataname>target.publish.jst.ear</dataname>
107
			<datavalue>deploy.j2ee.ear</datavalue>
108
		</publisherdata>
109
		<publisherdata>
110
			<dataname>target.unpublish.jst.ear</dataname>
111
			<datavalue>undeploy.j2ee.ear</datavalue>
112
		</publisherdata>		
113
	</publisher>
114
115
	<classpath id="was" >
116
	    <archive path="${wasHome}/properties" />
117
	    <archive path="${wasHome}/lib/startup.jar" />
118
	    <archive path="${wasHome}/lib/bootstrap.jar" />
119
        <archive path="${wasHome}/lib/j2ee.jar" />
120
        <archive path="${wasHome}/lib/lmproxy.jar" />
121
        <archive path="${wasHome}/lib/urlprotocols.jar" />
122
	</classpath>
123
124
	<classpath id="was.project">
125
	    <archive path="${wasHome}/lib/activation-impl.jar" />
126
	    <archive path="${wasHome}/lib/aspectjrt.jar" />
127
	    <archive path="${wasHome}/lib/base.jar" />
128
	    <archive path="${wasHome}/lib/bootstrap.jar" />
129
	    <archive path="${wasHome}/lib/bsf-engines.jar" />
130
	    <archive path="${wasHome}/lib/commandlineutils.jar" />
131
	    <archive path="${wasHome}/lib/EJBCommandTarget.jar" />
132
	    <archive path="${wasHome}/lib/htmlshell.jar" />
133
	    <archive path="${wasHome}/lib/installver.jar" />
134
	    <archive path="${wasHome}/lib/installxml.jar" />
135
	    <archive path="${wasHome}/lib/iscdeploy.jar" />
136
	    <archive path="${wasHome}/lib/ivblogbr.jar" />
137
	    <archive path="${wasHome}/lib/IVTClient.jar" />
138
	    <archive path="${wasHome}/lib/j2ee.jar" />
139
	    <archive path="${wasHome}/lib/jacl.jar" />
140
	    <archive path="${wasHome}/lib/launchclient.jar" />
141
	    <archive path="${wasHome}/lib/lmproxy.jar" />
142
	    <archive path="${wasHome}/lib/mail-impl.jar" />
143
	    <archive path="${wasHome}/lib/marshall.jar" />
144
	    <archive path="${wasHome}/lib/nif.jar" />
145
	    <archive path="${wasHome}/lib/pc-appext.jar" />
146
	    <archive path="${wasHome}/lib/physicalrep.jar" />
147
	    <archive path="${wasHome}/lib/pmirm4arm.jar" />
148
	    <archive path="${wasHome}/lib/rrd-appext.jar" />
149
	    <archive path="${wasHome}/lib/rsadbutils.jar" />
150
	    <archive path="${wasHome}/lib/rsahelpers.jar" />
151
	    <archive path="${wasHome}/lib/serviceadapter.jar" />
152
	    <archive path="${wasHome}/lib/sljc.jar" />
153
	    <archive path="${wasHome}/lib/spy-sl.jar" />
154
	    <archive path="${wasHome}/lib/spy.jar" />
155
	    <archive path="${wasHome}/lib/sqlserver.jar" />
156
	    <archive path="${wasHome}/lib/startup.jar" />
157
	    <archive path="${wasHome}/lib/tcljava.jar" />
158
	    <archive path="${wasHome}/lib/urlprotocols.jar" />
159
	    <archive path="${wasHome}/lib/util.jar" />
160
	    <archive path="${wasHome}/lib/wsatlib.jar" />
161
	    <archive path="${wasHome}/lib/wsif-compatb.jar" />
162
	</classpath>
163
	<jndiConnection>
164
		<providerUrl>iiop://${serverAddress}:2001</providerUrl>
165
		<initialContextFactory>org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory</initialContextFactory>
166
		<jndiProperty>
167
			<name></name>
168
			<value></value>
169
		</jndiProperty>
170
	</jndiConnection>
171
</tns:ServerRuntime>
(-)src/org/eclipse/jst/server/websphere/core/WebSphere61_ExternalServerBehavior.java (+112 lines)
Added Link Here
1
/**
2
 * 
3
 */
4
package org.eclipse.jst.server.websphere.core;
5
6
import java.io.FileNotFoundException;
7
import java.net.HttpURLConnection;
8
import java.net.URL;
9
import java.net.URLConnection;
10
11
import org.eclipse.debug.core.DebugEvent;
12
import org.eclipse.debug.core.DebugPlugin;
13
import org.eclipse.debug.core.IDebugEventSetListener;
14
import org.eclipse.debug.core.model.IProcess;
15
import org.eclipse.jst.server.generic.core.internal.ExternalServerBehaviour;
16
import org.eclipse.jst.server.generic.core.internal.Trace;
17
import org.eclipse.wst.server.core.IServer;
18
import org.eclipse.wst.server.core.ServerPort;
19
20
/**
21
 * Customized the ExtneralServerBehavior to handle using the WebSphere start/stop scripts
22
 * which terminate after the external server process has be started/stopped.
23
 * 
24
 * @author <a href="Eric.Norman@softwareag.com">Eric Norman</a>
25
 */
26
public class WebSphere61_ExternalServerBehavior extends ExternalServerBehaviour {
27
28
	/**
29
	 * Override to change what happens when the script process terminates 
30
	 */
31
    protected void setProcess(final IProcess newProcess) {
32
    	if (process != null)
33
    		return;
34
    	if(processListener!=null)
35
    		DebugPlugin.getDefault().removeDebugEventListener(processListener);
36
    	if (newProcess==null)
37
    		return;
38
    	process = newProcess;
39
    	processListener = new IDebugEventSetListener() {
40
    		public void handleDebugEvents(DebugEvent[] events) {
41
    			if (events != null) {
42
    				int size = events.length;
43
    				for (int i = 0; i < size; i++) {
44
    					if (process!= null &&  process.equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) {
45
    						DebugPlugin.getDefault().removeDebugEventListener(this);
46
47
    						if (getServer().getServerState() == IServer.STATE_STARTING) {
48
        						try {
49
            						Trace.trace(Trace.FINEST, "Ping: pinging"); //$NON-NLS-1$
50
51
            			    		String url = "http://"+getServer().getHost();; //$NON-NLS-1$
52
            			    	  	ServerPort[] ports = getServer().getServerPorts(null);
53
            			        	ServerPort sp = null;
54
            			    	    for(int p=0;p<ports.length;p++){
55
            			    	    	if(ports[i].getProtocol().equalsIgnoreCase("http")){//$NON-NLS-1$
56
            			    	    		sp=ports[p];
57
            			    	    	}
58
            			    	    }
59
            				    	if(sp==null){
60
            				    		Trace.trace(Trace.SEVERE, "Can't ping for server startup."); //$NON-NLS-1$
61
            							stopImpl();
62
            				    		return;
63
            				    	}
64
            			        	int port = sp.getPort();
65
            			    		if (port != 80)
66
            			    			url += ":" + port; //$NON-NLS-1$
67
            						
68
            						URL pingUrl = new URL(url);
69
            						URLConnection conn = pingUrl.openConnection();
70
            						((HttpURLConnection)conn).getResponseCode();
71
72
            						//no exception.  So it seems to be working...
73
            						Trace.trace(Trace.FINEST, "Ping: success"); //$NON-NLS-1$
74
            						if (process != null) {
75
            							process = null;
76
            							DebugPlugin.getDefault().removeDebugEventListener(processListener);
77
            							processListener = null;
78
            						}
79
            						setServerStarted();
80
        						} catch (FileNotFoundException fe) {
81
        							//this is ok. just mark the server as started
82
            						Trace.trace(Trace.FINEST, "Ping: FileNotFound"); //$NON-NLS-1$
83
            						if (process != null) {
84
            							process = null;
85
            							DebugPlugin.getDefault().removeDebugEventListener(processListener);
86
            							processListener = null;
87
            						}
88
            						setServerStarted();
89
        						} catch (Exception e) {
90
        							Trace.trace(Trace.FINEST, "Ping: failed: "+ e); //$NON-NLS-1$
91
        							// pinging failed
92
        							stopImpl();
93
        						}
94
    						} else {
95
    							//some other type of stop happening.
96
    							stopImpl();
97
    						}
98
    					}
99
    				}
100
    			}
101
    		}
102
    	};
103
    	DebugPlugin.getDefault().addDebugEventListener(processListener);
104
    }
105
    
106
	/**
107
	 * Override to disable the ping thread
108
	 */
109
	protected void startPingThread() {
110
		//don't use ping thread, just wait for the script to terminate before pinging.
111
	}
112
}

Return to bug 160220