You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Justin See <wa...@gmail.com> on 2006/05/28 18:31:12 UTC

Problem starting Tomcat in Netbeans

 Dear all,

I've tried to search for it but couldn't find an answer.
Please try to help me.

I've created an application and deployed and run successfully in the first
PC.
I copied everything over, installed everything as the first PC.


1) I've the mysql-connector-java-3.1.12-bin.jar in the common/lib.

2) Added this to the server.xml:

 <Context>

  <Resource name="jdbc/MySQLDB" auth="Container"
            type="javax.sql.DataSource" username="root" password="password"
            driverClassName=" com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/transport"
            maxActive="8" maxIdle="4"/>

</Context>

3) Added this to the web.xml

 <description>MySQL Connection</description>
   <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/MySQLDB</res-ref-name>
    <res-type> javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
   </resource-ref>



4) Set the environment variable: CLASSPATH=C:\Program Files\netbeans-
5.0\enterprise2\jakarta-tomcat-5.5.9\common
lib

Now when i deploy and start the application on the Tomcat,
Tomcat logs give me this error:


May 28, 2006 10:46:10 PM
org.apache.catalina.mbeans.ServerLifecycleListenercreateMBeans

SEVERE: createMBeans: Throwable

java.lang.NullPointerException

        at org.apache.catalina.mbeans.MBeanUtils.createObjectName(
MBeanUtils.java:1079)

        at org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java
:496)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:569)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:365)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:534)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:497)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:659)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:627)

        at org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(
ServerLifecycleListener.java:277)

        at org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent
(ServerLifecycleListener.java:128)

        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
LifecycleSupport.java:119)

        at org.apache.catalina.core.StandardServer.start(StandardServer.java
:676)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:324)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)

java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:324)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)

Caused by: java.lang.NullPointerException

        at java.util.Hashtable.put(Hashtable.java:393)

        at org.apache.catalina.core.StandardContext.resourcesStart(
StandardContext.java:3741)

        at org.apache.catalina.core.StandardContext.start(
StandardContext.java:3925)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java
:1012)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java
:718)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java
:1012)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java
:442)

May 28, 2006 10:46:11 PM org.apache.catalina.core.StandardService start

INFO: Starting service Catalina

May 28, 2006 10:46:11 PM org.apache.catalina.core.StandardEngine start

        at org.apache.catalina.core.StandardService.start(
StandardService.java:450)

INFO: Starting Servlet Engine: Apache Tomcat/5.5.9

        at org.apache.catalina.core.StandardServer.start(StandardServer.java
:683)

May 28, 2006 10:46:11 PM org.apache.catalina.core.StandardHost start

        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)

INFO: XML validation disabled

        ... 6 more


Thanks in advance!

-- 
Regards,
Justin See

Re: Problem starting Tomcat in Netbeans

Posted by Marc Farrow <ma...@gmail.com>.
I don't know why you have the Common folder of tomcat in your classpath.
that should not be needed.



On 5/28/06, michael@trollope.org <mi...@trollope.org> wrote:
>
> On Mon, May 29, 2006 at 12:31:12AM +0800, Justin See wrote:
>
> > I've tried to search for it but couldn't find an answer.
> > Please try to help me.
>
> > I've created an application and deployed and run successfully in the
> > first PC.  I copied everything over, installed everything as the
> > first PC.
>
> > 1) I've the mysql-connector-java-3.1.12-bin.jar in the common/lib.
>
> > 2) Added this to the server.xml:
>
> > <Context>
>
> >  <Resource name="jdbc/MySQLDB" auth="Container"
> >            type="javax.sql.DataSource" username="root"
> password="password"
> >            driverClassName=" com.mysql.jdbc.Driver"
> > url="jdbc:mysql://localhost:3306/transport"
> >            maxActive="8" maxIdle="4"/>
>
> > </Context>
>
> > 3) Added this to the web.xml
>
> > <description>MySQL Connection</description>
> >   <resource-ref>
> >    <description>DB Connection</description>
> >    <res-ref-name>jdbc/MySQLDB</res-ref-name>
> >    <res-type> javax.sql.DataSource</res-type>
> >    <res-auth>Container</res-auth>
> >   </resource-ref>
>
> > 4) Set the environment variable: CLASSPATH=C:\Program Files\netbeans-
> > 5.0\enterprise2\jakarta-tomcat-5.5.9\common
> > lib
>
> > Now when i deploy and start the application on the Tomcat, Tomcat
> > logs give me this error:
>
> > May 28, 2006 10:46:10 PM
> > org.apache.catalina.mbeans.ServerLifecycleListenercreateMBeans
>
> > SEVERE: createMBeans: Throwable
>
> > java.lang.NullPointerException
>
> >        at org.apache.catalina.mbeans.MBeanUtils.createObjectName(
> > MBeanUtils.java:1079)
>
> Are you using the Tomcat server distributed with NB, have you set this
> one up as an "external" server in NB or is this problem occurring
> outside of NB?
>
> If it is occurring when you 'run project' from within NB, then you may
> want to connect with the NetBeans user mailing list.  Additionally, if
> the application functions properly within NB but blows up when you
> deploy the .war file, the same applies.  Occasionally, there can be
> intricacies with deployment internally as opposed to externally.
> Usually, in my limited experience, this is because of difficulties in
> properly specifying the location of libraries.
>
> Thanks.
>
> mp
>
> --
> Michael Powe            michael@trollope.org            Naugatuck CT USA
>
>
> 47.3% of all statistics are made up on the spot. - Steven Wright
>
>
>


-- 
Marc Farrow

Re: Problem starting Tomcat in Netbeans

Posted by mi...@trollope.org.
On Mon, May 29, 2006 at 12:31:12AM +0800, Justin See wrote:

> I've tried to search for it but couldn't find an answer.
> Please try to help me.
 
> I've created an application and deployed and run successfully in the
> first PC.  I copied everything over, installed everything as the
> first PC.
 
> 1) I've the mysql-connector-java-3.1.12-bin.jar in the common/lib.
 
> 2) Added this to the server.xml:
 
> <Context>
 
>  <Resource name="jdbc/MySQLDB" auth="Container"
>            type="javax.sql.DataSource" username="root" password="password"
>            driverClassName=" com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/transport"
>            maxActive="8" maxIdle="4"/>
 
> </Context>
 
> 3) Added this to the web.xml
 
> <description>MySQL Connection</description>
>   <resource-ref>
>    <description>DB Connection</description>
>    <res-ref-name>jdbc/MySQLDB</res-ref-name>
>    <res-type> javax.sql.DataSource</res-type>
>    <res-auth>Container</res-auth>
>   </resource-ref>

> 4) Set the environment variable: CLASSPATH=C:\Program Files\netbeans-
> 5.0\enterprise2\jakarta-tomcat-5.5.9\common
> lib
 
> Now when i deploy and start the application on the Tomcat, Tomcat
> logs give me this error:

> May 28, 2006 10:46:10 PM
> org.apache.catalina.mbeans.ServerLifecycleListenercreateMBeans
 
> SEVERE: createMBeans: Throwable
 
> java.lang.NullPointerException
 
>        at org.apache.catalina.mbeans.MBeanUtils.createObjectName(
> MBeanUtils.java:1079)

Are you using the Tomcat server distributed with NB, have you set this
one up as an "external" server in NB or is this problem occurring
outside of NB?

If it is occurring when you 'run project' from within NB, then you may
want to connect with the NetBeans user mailing list.  Additionally, if
the application functions properly within NB but blows up when you
deploy the .war file, the same applies.  Occasionally, there can be
intricacies with deployment internally as opposed to externally.
Usually, in my limited experience, this is because of difficulties in
properly specifying the location of libraries.

Thanks.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA


47.3% of all statistics are made up on the spot. - Steven Wright