Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Error starting server(Error starting my own server runtime)
Error starting server [message #509469] Fri, 22 January 2010 14:30 Go to next message
Cristina  is currently offline Cristina
Messages: 8
Registered: January 2010
Junior Member
Hello All,

I have extend the "Servers" view plug-in by defining my own server type. The extension seems to be working well, opening the Servers view I am able to create a new server of the type I've created.

When I press the Start buttom of the server, I can see the server working (doing what it is mean to do), but eclipse is still "Starting server al localhost". After a while, I get
an error saying "Starting server at localhost has encountered a problem" "Server al localhost was unable to start within 120 seconds".The problems is that although the server is doing what it is supposed to do, eclipse is not aware of that and stops the server after 120 seconds...

I'm not sure about this, but...it seems like I have to code something in my server start runtime in order to eclipse recognise that the server have been started correctly. Any clue about that?

Many thanks in advance.
Re: Error starting server [message #509488 is a reply to message #509469] Fri, 22 January 2010 10:20 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
Cristina wrote:
> Hello All,
> I have extend the "Servers" view plug-in by defining my own server type.
> The extension seems to be working well, opening the Servers view I am
> able to create a new server of the type I've created.
>
> When I press the Start buttom of the server, I can see the server
> working (doing what it is mean to do), but eclipse is still "Starting
> server al localhost". After a while, I get an error saying "Starting
> server at localhost has encountered a problem" "Server al localhost was
> unable to start within 120 seconds".The problems is that although the
> server is doing what it is supposed to do, eclipse is not aware of that
> and stops the server after 120 seconds...
>
> I'm not sure about this, but...it seems like I have to code something in
> my server start runtime in order to eclipse recognise that the server
> have been started correctly. Any clue about that?
>
> Many thanks in advance.

The WTP Tomcat support simply tries to ping the server via
"http://localhost". This timeout says this ping never succeeded. It
would help to know which version of WTP you are using and how your
connectors are configured in the servers.xml found under the Servers
project in your workspace.

Cheers,
Larry
Re: Error starting server [message #509724 is a reply to message #509488] Mon, 25 January 2010 08:24 Go to previous messageGo to next message
Cristina  is currently offline Cristina
Messages: 8
Registered: January 2010
Junior Member
Hello Larry,

I'm using the last version of WTP available on the site.

To define my own server, I've follow the steps described in the "eclipse Web tools Platform" book, Chapter12, adding new servers example.
In the last step of the example I've to define the "Publishers", and as I don't have too much information about how to do it, I just copied that code of the example...

[code]
<project name="deployextension" default="deploy.j2ee.web" basedir="." xmlns:artifact="urn:maven-artifact-ant">

<property name="newDeployPause" value="6"/>
<property name="reDeployPause" value="3"/>

<!-- only deploy if the archive does not exist in the auto deploy dir or
the source is more recent -->
<target name="deploy.j2ee.web" depends="-checkWebDeploy" unless="notNeeded">
<jar destfile="${project.working.dir}/${module.name}.war">
<zipfileset dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/jsp_servlet/*.class"/>
<exclude name="**/*.war"/>
</zipfileset>
</jar>
<!-- set the pause to either the "new" or the "redeploy" value depending
on whether the archive already exists in the autodeploy dir -->
<available property="exists" file="${server.publish.dir}/${module.name}.war"/>
<condition property="pause" value="${newDeployPause}">
<not>
<istrue value="${exists}"/>
</not>
</condition>
<condition property="pause" value="${reDeployPause}">
<istrue value="${exists}"/>
</condition>
<move file="${project.working.dir}/${module.name}.war" todir="${server.publish.dir}"/>
<!-- delay in seconds to the server a chance to pick up the autodeployment -->
<sleep seconds="${pause}"/>
</target>
<target name="-checkWebDeploy">
<uptodate property="notNeeded" targetfile="${server.publish.dir}/${module.name}.war">
<srcfiles dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/jsp_servlet/*.class"/>
<exclude name="**/*.war"/>
</srcfiles>
</uptodate>
</target>

<target name="deploy.j2ee.ejb" depends="-checkEJBDeploy" unless="notNeeded">
<jar destfile="${project.working.dir}/${module.name}.jar">
<zipfileset dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/*.java"/>
</zipfileset>
</jar>
<!-- set the pause to either the "new" or the "redeploy" value depending
on whether the archive already exists in the autodeploy dir -->
<available property="exists" file="${server.publish.dir}/${module.name}.jar"/>
<condition property="pause" value="${newDeployPause}">
<not>
<istrue value="${exists}"/>
</not>
</condition>
<condition property="pause" value="${reDeployPause}">
<istrue value="${exists}"/>
</condition>
<move file="${project.working.dir}/${module.name}.jar" todir="${server.publish.dir}"/>
<!-- delay in seconds to the server a chance to pick up the autodeployment -->
<sleep seconds="${pause}"/>
</target>
<target name="-checkEJBDeploy">
<uptodate property="notNeeded
Re: Error starting server [message #509822 is a reply to message #509724] Mon, 25 January 2010 09:28 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
Am I correct in assuming that if you remove all projects from the Server
and start it, it still times out after 120 seconds?

Cheers,
Larry

Cristina wrote:
> Hello Larry,
>
> I'm using the last version of WTP available on the site.
>
> To define my own server, I've follow the steps described in the "eclipse
> Web tools Platform" book, Chapter12, adding new servers example.
> In the last step of the example I've to define the "Publishers", and as
> I don't have too much information about how to do it, I just copied that
> code of the example...
>
> [code]
> <project name="deployextension" default="deploy.j2ee.web" basedir="."
> xmlns:artifact="urn:maven-artifact-ant">
>
> <property name="newDeployPause" value="6"/>
> <property name="reDeployPause" value="3"/>
>
> <!-- only deploy if the archive does not exist in the auto deploy
> dir or
> the source is more recent -->
> <target name="deploy.j2ee.web" depends="-checkWebDeploy"
> unless="notNeeded">
> <jar destfile="${project.working.dir}/${module.name}.war">
> <zipfileset dir="${module.dir}">
> <include name="**/*.*"/>
> <exclude name="**/jsp_servlet/*.class"/>
> <exclude name="**/*.war"/>
> </zipfileset>
> </jar>
> <!-- set the pause to either the "new" or the "redeploy" value
> depending
> on whether the archive already exists in the autodeploy dir
> -->
> <available property="exists"
> file="${server.publish.dir}/${module.name}.war"/>
> <condition property="pause" value="${newDeployPause}">
> <not>
> <istrue value="${exists}"/>
> </not>
> </condition>
> <condition property="pause" value="${reDeployPause}">
> <istrue value="${exists}"/>
> </condition>
> <move file="${project.working.dir}/${module.name}.war"
> todir="${server.publish.dir}"/>
> <!-- delay in seconds to the server a chance to pick up the
> autodeployment -->
> <sleep seconds="${pause}"/>
> </target>
> <target name="-checkWebDeploy">
> <uptodate property="notNeeded"
> targetfile="${server.publish.dir}/${module.name}.war">
> <srcfiles dir="${module.dir}">
> <include name="**/*.*"/>
> <exclude name="**/jsp_servlet/*.class"/>
> <exclude name="**/*.war"/>
> </srcfiles>
> </uptodate>
> </target>
>
> <target name="deploy.j2ee.ejb" depends="-checkEJBDeploy"
> unless="notNeeded">
> <jar destfile="${project.working.dir}/${module.name}.jar">
> <zipfileset dir="${module.dir}">
> <include name="**/*.*"/>
> <exclude name="**/*.java"/>
> </zipfileset>
> </jar>
> <!-- set the pause to either the "new" or the "redeploy" value
> depending
> on whether the archive already exists in the autodeploy dir
> -->
> <available property="exists"
> file="${server.publish.dir}/${module.name}.jar"/>
> <condition property="pause" value="${newDeployPause}">
> <not>
> <istrue value="${exists}"/>
> </not>
> </condition>
> <condition property="pause" value="${reDeployPause}">
> <istrue value="${exists}"/>
> </condition>
> <move file="${project.working.dir}/${module.name}.jar"
> todir="${server.publish.dir}"/>
> <!-- delay in seconds to the server a chance to pick up the
> autodeployment -->
> <sleep seconds="${pause}"/>
> </target>
> <target name="-checkEJBDeploy">
> <uptodate property="notNeeded
Re: Error starting server [message #510016 is a reply to message #509469] Tue, 26 January 2010 08:43 Go to previous messageGo to next message
Cristina  is currently offline Cristina
Messages: 8
Registered: January 2010
Junior Member
I haven't link manually the publisher file to any part of the plug-in so if I delete the projects within it, the server will continue timing out...
Where I am supposed to do so? I copied this configuration because I wanted a generic implementation...should I implement my own publishers?

I know that these are dummy questions, but I don't have so much experience in this area. Embarrassed

Many thanks in advance.


Re: Error starting server [message #510262 is a reply to message #510016] Wed, 27 January 2010 00:27 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
Cristina wrote:
> I haven't link manually the publisher file to any part of the plug-in so
> if I delete the projects within it, the server will continue timing out...
> Where I am supposed to do so? I copied this configuration because I
> wanted a generic implementation...should I implement my own publishers?
>
> I know that these are dummy questions, but I don't have so much
> experience in this area. :blush:
> Many thanks in advance.
>
>
>

Sorry, I'm a little slow discovering the significance of "Chapter 12"
and understanding what you are really asking. Would I be correct in
assuming you are using the generic server support to create your new
server type? If so, do you have source for the
org.eclipse.jst.server.generic.core plug-in in your workspace?

Cheers,
Larry
Re: Error starting server [message #510307 is a reply to message #509469] Wed, 27 January 2010 08:15 Go to previous messageGo to next message
Cristina  is currently offline Cristina
Messages: 8
Registered: January 2010
Junior Member
Sorry, Chapter 12 describes an example of how to add a generic server adapter to the "Servers" view of WTP.

What I am trying to do is to add a new server adapter, with the peculiarity that the server is a plug-in that I've developed.

You are correct about the generic server support and the org.eclipse.jst.server.generic.core plug-in is available in the workspace.

This is the plugin.xml file content:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.wst.server.core.runtimeTypes">
      <runtimeType
            class="org.eclipse.jst.server.generic.core.internal.GenericServerRuntime"
            description="Fresh server runtime"
            id="eu.project.plugins.server.fresh.runtime"
            name="Fresh Server"
            vendor="Fresh"
            vendorId="Fresh"
            version="1.0">
      </runtimeType>
   </extension>
      <extension
         point="org.eclipse.wst.server.core.serverTypes">
      <serverType
            behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
            class="org.eclipse.jst.server.generic.core.internal.GenericServer"
            description="Fresh Server"
            hasConfiguration="false"
            id="eu.project.plugins.server.fresh.server"
            initialState="stopped"
            launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
            launchModes="run, debug"
            name="Fresh Server"
            runtime="true"
            runtimeTypeId="eu.project.plugins.server.fresh.runtime"
            startBeforePublish="true"
            startTimeout="120000"
            stopTimeout="15000"
            supportsRemoteHosts="true">
      </serverType>
   </extension>
      <extension
            point="org.eclipse.wst.common.project.facet.core.runtimes">
         <runtime-component-type
               id="eu.project.plugins.server.fresh">
         </runtime-component-type>
         <runtime-component-version
               type="eu.project.plugins.server.fresh"
               version="1.0">
         </runtime-component-version>
         <supported>
            <facet
                  id="jst.utility"
                  version="1.0">
            </facet>
            <runtime-component
                  id="eu.project.plugins.server.fresh"
                  version="1.0">
            </runtime-component>
         </supported>
         <adapter>
            <runtime-component
                  id="eu.project.plugins.server.fresh">
            </runtime-component>
            <factory
                  class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory">
            </factory>
            <type
                  class="org.eclipse.jst.common.project.facet.core.IClasspathProvider">
            </type>
         </adapter>
         <adapter>
            <runtime-component
                  id="eu.project.plugins.server.fresh">
            </runtime-component>
            <factory
                  class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory">
            </factory>
            <type
                  class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider">
            </type>
         </adapter>
      </extension>
      <extension
            point="org.eclipse.jst.server.core.runtimeClasspathProviders">
         <runtimeClasspathProvider
               class="org.eclipse.jst.server.generic.core.internal.GenericServerRuntimeTargetHandler"
               id="eu.project.plugins.server.fresh.runtimeClasspathProvider"
               runtimeTypeIds="eu.project.plugins.server.fresh.*">
         </runtimeClasspathProvider>
      </extension>
      <extension
         point="org.eclipse.jst.server.core.runtimeFacetMappings">
      <runtimeFacetMapping
            runtime-component="eu.project.plugins.server.fresh"
            runtimeTypeId="eu.project.plugins.server.fresh.runtime"
            version="1.0">
      </runtimeFacetMapping>
   </extension>
   <extension
         point="org.eclipse.wst.server.ui.wizardFragments">
      <fragment
            class="org.eclipse.jst.server.generic.ui.internal.GenericServerRuntimeWizardFragment"
            id="org.eclipse.jst.server.generic.runtime"
            typeIds="eu.project.plugins.server.fresh.runtime">
      </fragment>
      <fragment
            class="org.eclipse.jst.server.generic.ui.internal.GenericServerWizardFragment"
            id="org.eclipse.jst.server.generic.server"
            typeIds="eu.project.plugins.server.fresh.server">
      </fragment>
   </extension>
   <extension
         point="org.eclipse.wst.server.ui.serverImages">
      <image
            icon="icons/server.GIF"
            id="org.eclipse.jst.server.generic.image"
            typeIds="eu.project.plugins.server.fresh.runtime">
      </image>
      <image
            icon="icons/server.GIF"
            id="org.eclipse.jst.server.generic.image"
            typeIds="eu.project.plugins.server.fresh.server">
      </image>
   </extension>
   <extension
         point="org.eclipse.wst.common.project.facet.ui.images">
      <image
            path="icons/server.GIF"
            runtime-component-type="eu.project.plugins.server.fresh">
      </image>
   </extension>
   <extension
         point="org.eclipse.jst.server.generic.core.serverdefinition">
      <serverdefinition
            definitionfile="fresh.serverdef"
            id="eu.project.plugins.server.fresh.runtime">
      </serverdefinition>
   </extension>

</plugin>

Re: Error starting server [message #510433 is a reply to message #510307] Wed, 27 January 2010 14:11 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
I'm not an expert on the generic server support in WTP, so I can only
offer suggestions based on what knowledge I possess. I haven't read
Chapter 12 in detail, but I doubt it provides enough detail to
understand the subtleties of the actual implementation. Also, there
could be important changes in the code since the book was published.
You will need to study and understand the generic.core plug-in source to
some extent to accomplish what you want.

With respect to the timeout problem, the key is the PingThread class in
the generic.core plug-in. The PingThread.ping() method makes the
determination if the server has started or not. If you search out
references to this class you will find it is referenced from
GenericServerBehaviour.startPingThread(). It is there that the URL to
ping gets built. If not built correctly, such as the port being
incorrect, then pinging that URL is doomed to failure and the symptom
you are seeing results. You may want to debug through that code to see
if that ping URL is what it should be.

Cheers,
Larry

Cristina wrote:
> Sorry, Chapter 12 describes an example of how to add a generic server
> adapter to the "Servers" view of WTP.
>
> What I am trying to do is to add a new server adapter, with the
> peculiarity that the server is a plug-in that I've developed.
>
> You are correct about the generic server support and the
> org.eclipse.jst.server.generic.core plug-in is available in the workspace.
>
> This is the plugin.xml file content:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.4"?>
> <plugin>
> <extension
> point="org.eclipse.wst.server.core.runtimeTypes">
> <runtimeType
>
> class=" org.eclipse.jst.server.generic.core.internal.GenericServerRu ntime "
> description="Fresh server runtime"
> id="eu.project.plugins.server.fresh.runtime"
> name="Fresh Server"
> vendor="Fresh"
> vendorId="Fresh"
> version="1.0">
> </runtimeType>
> </extension>
> <extension
> point="org.eclipse.wst.server.core.serverTypes">
> <serverType
>
> behaviourClass=" org.eclipse.jst.server.generic.core.internal.GenericServerBe haviour "
>
>
> class="org.eclipse.jst.server.generic.core.internal.GenericServer "
> description="Fresh Server"
> hasConfiguration="false"
> id="eu.project.plugins.server.fresh.server"
> initialState="stopped"
>
> launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType "
>
> launchModes="run, debug"
> name="Fresh Server"
> runtime="true"
> runtimeTypeId="eu.project.plugins.server.fresh.runtime"
> startBeforePublish="true"
> startTimeout="120000"
> stopTimeout="15000"
> supportsRemoteHosts="true">
> </serverType>
> </extension>
> <extension
> point="org.eclipse.wst.common.project.facet.core.runtimes">
> <runtime-component-type
> id="eu.project.plugins.server.fresh">
> </runtime-component-type>
> <runtime-component-version
> type="eu.project.plugins.server.fresh"
> version="1.0">
> </runtime-component-version>
> <supported>
> <facet
> id="jst.utility"
> version="1.0">
> </facet>
> <runtime-component
> id="eu.project.plugins.server.fresh"
> version="1.0">
> </runtime-component>
> </supported>
> <adapter>
> <runtime-component
> id="eu.project.plugins.server.fresh">
> </runtime-component>
> <factory
>
> class=" org.eclipse.jst.server.core.internal.RuntimeClasspathProvide r$Factory ">
>
> </factory>
> <type
>
> class=" org.eclipse.jst.common.project.facet.core.IClasspathProvider ">
> </type>
> </adapter>
> <adapter>
> <runtime-component
> id="eu.project.plugins.server.fresh">
> </runtime-component>
> <factory
>
> class=" org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Fact ory ">
> </factory>
> <type
>
> class=" org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLab elProvider ">
>
> </type>
> </adapter>
> </extension>
> <extension
> point="org.eclipse.jst.server.core.runtimeClasspathProviders ">
> <runtimeClasspathProvider
>
> class=" org.eclipse.jst.server.generic.core.internal.GenericServerRu ntimeTargetHandler "
>
> id="eu.project.plugins.server.fresh.runtimeClasspathProvider "
> runtimeTypeIds="eu.project.plugins.server.fresh.*">
> </runtimeClasspathProvider>
> </extension>
> <extension
> point="org.eclipse.jst.server.core.runtimeFacetMappings">
> <runtimeFacetMapping
> runtime-component="eu.project.plugins.server.fresh"
> runtimeTypeId="eu.project.plugins.server.fresh.runtime"
> version="1.0">
> </runtimeFacetMapping>
> </extension>
> <extension
> point="org.eclipse.wst.server.ui.wizardFragments">
> <fragment
>
> class=" org.eclipse.jst.server.generic.ui.internal.GenericServerRunt imeWizardFragment "
>
> id="org.eclipse.jst.server.generic.runtime"
> typeIds="eu.project.plugins.server.fresh.runtime">
> </fragment>
> <fragment
>
> class=" org.eclipse.jst.server.generic.ui.internal.GenericServerWiza rdFragment "
>
> id="org.eclipse.jst.server.generic.server"
> typeIds="eu.project.plugins.server.fresh.server">
> </fragment>
> </extension>
> <extension
> point="org.eclipse.wst.server.ui.serverImages">
> <image
> icon="icons/server.GIF"
> id="org.eclipse.jst.server.generic.image"
> typeIds="eu.project.plugins.server.fresh.runtime">
> </image>
> <image
> icon="icons/server.GIF"
> id="org.eclipse.jst.server.generic.image"
> typeIds="eu.project.plugins.server.fresh.server">
> </image>
> </extension>
> <extension
> point="org.eclipse.wst.common.project.facet.ui.images">
> <image
> path="icons/server.GIF"
> runtime-component-type="eu.project.plugins.server.fresh">
> </image>
> </extension>
> <extension
> point="org.eclipse.jst.server.generic.core.serverdefinition ">
> <serverdefinition
> definitionfile="fresh.serverdef"
> id="eu.project.plugins.server.fresh.runtime">
> </serverdefinition>
> </extension>
>
> </plugin>
>
>
Previous Topic:Project template
Next Topic:Can't get logfiles for tomcat 5.5
Goto Forum:
  


Current Time: Thu Oct 02 00:25:21 GMT 2014

Powered by FUDForum. Page generated in 0.01978 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software