Solved

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

Posted on 2006-11-20
37
17,720 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
ID: 17984382
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
ID: 17984434
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
ID: 17984449
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
ID: 17984457
>>"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
ID: 17984461
oh sure.

Thanks.
0
 

Author Comment

by:mustish1
ID: 17984477
0
 

Author Comment

by:mustish1
ID: 17984484
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
ID: 17984487
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
ID: 17984512
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
ID: 17984515
Mmm....give me a sec
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 17984524
Can you post your build.xml?
0
 

Author Comment

by:mustish1
ID: 17984526
ok
0
 

Author Comment

by:mustish1
ID: 17984547
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
ID: 17984553
Can you post nbproject/build-impl.xml as well as your build.xml is importing this file?
0
 

Author Comment

by:mustish1
ID: 17984556
ok
0
 

Author Comment

by:mustish1
ID: 17984563
0
 

Author Comment

by:mustish1
ID: 17984569
This file i copied from folder

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

0
 
LVL 16

Expert Comment

by:suprapto45
ID: 17984584
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mustish1
ID: 17984587
ok no problem. Thanks to give me a time.
0
 

Author Comment

by:mustish1
ID: 17984593
<?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
ID: 17984600
Are there any .properties file in this folder?
0
 

Author Comment

by:mustish1
ID: 17984602
one sec i check
0
 

Author Comment

by:mustish1
ID: 17984607
genfiles.properties
project.properties
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 17984612
what are the contents of project.properties?
0
 

Author Comment

by:mustish1
ID: 17984615
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
ID: 17984628
Any .url file?
0
 

Author Comment

by:mustish1
ID: 17984632
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
ID: 17984638
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
ID: 17984639
Only Yahoo url files are there
0
 

Author Comment

by:mustish1
ID: 17984643
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
ID: 17984652
>>"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
ID: 17987605
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
ID: 17992312
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
ID: 17992318
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
ID: 17992561
>>"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
ID: 17992577
Ok thanks David.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 17992600
Glad I could help

David
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

22 Experts available now in Live!

Get 1:1 Help Now