Solved

Starting of Tomcat failed, the server port 8084 is already in use.

Posted on 2006-11-20
37
17,577 Views
Last Modified: 2011-09-20
Hi: I am using NetBeans IDE 5.5. when I compile it it gives that message. How do i fix that error?

Thanks.
0
Comment
Question by:mustish1
  • 21
  • 16
37 Comments
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Hi,

It means that the port 8084 has already been used. I assumed that you run your embedded Tomcat within NetBeans. You need to change the port of your embedded Tomcat to other ports such as 8002 or anything.

http://www.dimensionex.net/en/docs/art008.htm

I think that your Tomcat is somewhere in <NETBEANS_FOLDER>/enterprises/tomcat....if I am not mistaken.

David
0
 

Author Comment

by:mustish1
Comment Utility
Thanks David. I am using Windows 2000. This is the path of the Tomcat
C:\Program Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\conf

But when i type http://localhost. IIS is start running as a default. I did change on that line but NetBeans still give me same error:
Starting of Tomcat failed, the server port 8084 is already in use.

I didnt find any thing like 8084 in that conf.xml file.
--------------------------------------------------------------------------------------------------
    <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
    <Connector port="80" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
     to 0 -->
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Hi,

Do not change to 80 then. It means that IIS is using your port 80. Try to change to some other values. How about 8089?

David
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
>>"I didnt find any thing like 8084 in that conf.xml file. "
Hmm....

Can you post your server.xml in your C:\Program Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\conf?
0
 

Author Comment

by:mustish1
Comment Utility
oh sure.

Thanks.
0
 

Author Comment

by:mustish1
Comment Utility
0
 

Author Comment

by:mustish1
Comment Utility
I dont know where i do the change in the file so i upload it. If any one please tell me where would i go to change the port setting?

Thanks.
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Hi,

Try to change
<Connector port="80" maxHttpHeaderSize="8192"

into
<Connector port="8089" maxHttpHeaderSize="8192"

Remember that you need to save it as server.xml. And try to run your Tomcat from your NetBeans again.

David
0
 

Author Comment

by:mustish1
Comment Utility
It gives me same error:

Starting of Tomcat failed, the server port 8084 is already in use.
C:\Documents and Settings\Eric\WebApplication1\nbproject\build-impl.xml:440: Deployment error:
Starting of Tomcat failed, the server port 8084 is already in use.
See the server log for details.
BUILD FAILED (total time: 34 seconds)
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Mmm....give me a sec
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Can you post your build.xml?
0
 

Author Comment

by:mustish1
Comment Utility
ok
0
 

Author Comment

by:mustish1
Comment Utility
This file i copied it from my folder:
C:\Documents and Settings\Eric\WebApplication1

<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="WebApplication1" default="default" basedir=".">
    <description>Builds, tests, and runs the project WebApplication1.</description>
    <import file="nbproject/build-impl.xml"/>
    <!--

    There exist several targets which are by default empty and which can be
    used for execution of your tasks. These targets are usually executed
    before and after some main targets. They are:

      -pre-init:                 called before initialization of project properties
      -post-init:                called after initialization of project properties
      -pre-compile:              called before javac compilation
      -post-compile:             called after javac compilation
      -pre-compile-single:       called before javac compilation of single file
      -post-compile-single:      called after javac compilation of single file
      -pre-compile-test:         called before javac compilation of JUnit tests
      -post-compile-test:        called after javac compilation of JUnit tests
      -pre-compile-test-single:  called before javac compilation of single JUnit test
      -post-compile-test-single: called after javac compilation of single JUunit test
      -pre-dist:                 called before jar building
      -post-dist:                called after jar building
      -post-clean:               called after cleaning build products
      -pre-run-deploy:           called before deploying
      -post-run-deploy:          called after deploying

    Example of pluging an obfuscator after the compilation could look like

        <target name="post-compile">
            <obfuscate>
                <fileset dir="${build.classes.dir}"/>
            </obfuscate>
        </target>

    For list of available properties check the imported
    nbproject/build-impl.xml file.


    Other way how to customize the build is by overriding existing main targets.
    The target of interest are:

      init-macrodef-javac:    defines macro for javac compilation
      init-macrodef-junit:   defines macro for junit execution
      init-macrodef-debug:    defines macro for class debugging
      do-dist:                jar archive building
      run:                    execution of project
      javadoc-build:          javadoc generation

    Example of overriding the target for project execution could look like

        <target name="run" depends="<PROJNAME>-impl.jar">
            <exec dir="bin" executable="launcher.exe">
                <arg file="${dist.jar}"/>
            </exec>
        </target>

    Notice that overridden target depends on jar target and not only on
    compile target as regular run target does. Again, for list of available
    properties which you can use check the target you are overriding in
    nbproject/build-impl.xml file.

    -->
</project>
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Can you post nbproject/build-impl.xml as well as your build.xml is importing this file?
0
 

Author Comment

by:mustish1
Comment Utility
ok
0
 

Author Comment

by:mustish1
Comment Utility
0
 

Author Comment

by:mustish1
Comment Utility
This file i copied from folder

C:\Documents and Settings\Eric\WebApplication1\nbproject\build-impl.xml

0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Sorry,

Another one...

<import file="ant-deploy.xml"/>

Can you post your ant-deploy.xml? This may be the problem as it is error in deploying your app.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:mustish1
Comment Utility
ok no problem. Thanks to give me a time.
0
 

Author Comment

by:mustish1
Comment Utility
<?xml version="1.0" encoding="UTF-8"?>
<project default="-deploy-ant" basedir=".">
    <target

name="-init" if="deploy.ant.enabled">k
        <property file="${deploy.ant.properties.file}"/>
   

     <tempfile property="temp.module.folder" prefix="tomcat" destdir="${java.io.tmpdir}"/>
       

 <unwar src="${deploy.ant.archive}" dest="${temp.module.folder}">
            <patternset

includes="META-INF/context.xml"/>
        </unwar>
        <xmlproperty

file="${temp.module.folder}/META-INF/context.xml"/>
        <delete

dir="${temp.module.folder}"/>
    </target>
    <target name="-deploy-ant"

if="deploy.ant.enabled" depends="-init">
        <echo message="Deploying ${deploy.ant.archive}

to ${Context(path)}"/>
        <taskdef name="deploy"

classname="org.apache.catalina.ant.DeployTask"
                 

classpath="${tomcat.home}/server/lib/catalina-ant.jar"/>
        <deploy

url="${tomcat.url}/manager" username="${tomcat.username}"
               

password="${tomcat.password}" path="${Context(path)}"
               

war="${deploy.ant.archive}"/>
        <property name="deploy.ant.client.url"

value="${tomcat.url}${Context(path)}"/>
    </target>
    <target name="-undeploy-ant"

if="deploy.ant.enabled" depends="-init">
        <echo message="Undeploying ${Context(path)}"/>
 

      <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"
               

classpath="${tomcat.home}/server/lib/catalina-ant.jar"/>
        <undeploy

url="${tomcat.url}/manager" username="${tomcat.username}"
                 

password="${tomcat.password}" path="${Context(path)}"/>
    </target>
</project>
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Are there any .properties file in this folder?
0
 

Author Comment

by:mustish1
Comment Utility
one sec i check
0
 

Author Comment

by:mustish1
Comment Utility
genfiles.properties
project.properties
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
what are the contents of project.properties?
0
 

Author Comment

by:mustish1
Comment Utility
build.classes.dir=${build.web.dir}/WEB-INF/classes
build.classes.excludes=**/*.java,**/*.form
build.dir=build
build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes
build.ear.web.dir=${build.dir}/ear-module
build.generated.dir=${build.dir}/generated
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
build.web.dir=${build.dir}/web
build.web.excludes=${build.classes.excludes}
client.urlPart=
compile.jsps=false
conf.dir=${source.root}/conf
debug.classpath=${javac.classpath}:${build.classes.dir}:${build.ear.classes.dir}
debug.test.classpath=\
    ${run.test.classpath}
display.browser=true
dist.dir=dist
dist.ear.war=${dist.dir}/${war.ear.name}
dist.javadoc.dir=${dist.dir}/javadoc
dist.war=${dist.dir}/${war.name}
j2ee.platform=1.4
j2ee.server.type=Tomcat55
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.debug=true
javac.deprecation=false
javac.source=1.4
javac.target=1.4
javac.test.classpath=\
    ${javac.classpath}:\
    ${build.classes.dir}:\
    ${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.preview=true
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
jspcompilation.classpath=${jspc.classpath}:${javac.classpath}
lib.dir=${web.docbase.dir}/WEB-INF/lib
no.dependencies=false
platform.active=default_platform
resource.dir=setup
run.test.classpath=\
    ${javac.test.classpath}:\
    ${build.test.classes.dir}
# Space-separated list of JVM arguments used when running class with main method
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
runmain.jvmargs=
source.root=src
src.dir=${source.root}/java
test.src.dir=test
war.content.additional=
war.ear.name=WebApplication1.war
war.name=WebApplication1.war
war.package=true
web.docbase.dir=web
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Any .url file?
0
 

Author Comment

by:mustish1
Comment Utility
I didnt find any of it but i will be search it in that folder Document and Settings.
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Mm.....I never think that changing the embedded Tomcat inside NetBeans is rather difficult.

I may need to test it in another machine that has NetBeans. However, I may do it in the evening so I think that you have to wait for that.
0
 

Author Comment

by:mustish1
Comment Utility
Only Yahoo url files are there
0
 

Author Comment

by:mustish1
Comment Utility
ok thanks no problem i also want to go on bed as my girl is looking with very angry eyes.

0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
>>"ok thanks no problem i also want to go on bed as my girl is looking with very angry eyes."
Watch out and enjoy :).
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Hello,

I have checked my NetBeans 5.5.

Assuming that you use either WinXP or Win2000, try to find server.xml located in your Document and Setting folder. In my PC, it is in
C:\Documents and Settings\Administrator\.netbeans\5.5\apache-tomcat-5.5.17_base\conf

Find the line as
    <Connector URIEncoding="utf-8" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8084" redirectPort="8443"/>

As you can see, it is 8084 as the port. Try to change it to something else such as 8099. And try to run your project again.

Good luck

David
0
 

Author Comment

by:mustish1
Comment Utility
Thanks David i just did the changes and it works cheers. Second thing which i observe is i shut down the IDE and the tomcat is still running. I open the index.jsp file and did some changes and it shows the changes there. So just to know does the web server really works without loading the netbeans as i guess is every thing is in netbeans-5.5 bundle.
0
 

Author Comment

by:mustish1
Comment Utility
Basically i feel comfortable to open a notepad and start writting instead of using netbeans. If i can use the webserver without loading the IDE then its really great.
0
 
LVL 16

Accepted Solution

by:
suprapto45 earned 500 total points
Comment Utility
>>"Second thing which i observe is i shut down the IDE and the tomcat is still running."
It should shut down Tomcat automatically IF you run your Tomcat WITHIN the NetBeans. It won't shutdown if you start your Tomcat from OUTSIDE the NetBeans.

>>"Basically i feel comfortable to open a notepad and start writting instead of using netbeans. If i can use the webserver without loading the IDE then its really great."
Yes, you can do that. Why not? NetBeans is created for you to ease your programming language. Similarly, Eclipse, JCreator and those Java IDEs are created to make you faster in your programming language.

If I am not wrong, this is what happens when your run your project. It builds your Web Application to either WAR or EAR file and deploy it automatically to Tomcat. So you can do these procedures manually without NetBeans but it is rather complicated and complex.

My suggestion to you is to stick with IDE but you need to understand the concept as well.

David
0
 

Author Comment

by:mustish1
Comment Utility
Ok thanks David.
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Glad I could help

David
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now