Back Forum Reply New

Help on run webapps in tomcat

beans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)       at org.apache.coyote.from11.from11Processor.process(from11Processor.java:844)       at org.apache.coyote.from11.from11Protocol$from11ConnectionHandler.process(from11Protocol.java:584)       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)       at java.lang.Thread.run(Thread.java:619)
5-apr-2008 22.49.28 org.apache.catalina.core.StandardContext listenerStart
GRAVE: Skipped installing application listeners due to previous error(s)
web.xml

Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;

lt;web-app version=quot;2.4quot;        xmlns=quot;xml/ns/j2eequot;        xmlns:xsi=quot;2001/XMLSchema-instancequot;        xsi:schemaLocation=quot;xml/ns/j2ee         xml/ns/j2ee/web-app_2_4.xsdquot; gt;
lt;context-paramgt;       lt;param-namegt;contextConfigLocationlt;/param-namegt;       lt;param-valuegt;/WEB-INF/applicationContext.xmllt;/param-valuegt;   lt;/context-paramgt; lt;listenergt;   lt;listener-classgt;org..web.context.ContextLoaderListenerlt;/listener-classgt; lt;/listenergt;
lt;servletgt;   lt;servlet-namegt;springapplt;/servlet-namegt;   lt;servlet-classgt;org..web.servlet.DispatcherServletlt;/servlet-classgt;   lt;load-on-startupgt;1lt;/load-on-startupgt; lt;/servletgt;
lt;servlet-mappinggt;   lt;servlet-namegt;springapplt;/servlet-namegt;   lt;ucl-patterngt;*.htmlt;/ucl-patterngt; lt;/servlet-mappinggt;
lt;welcome-file-listgt;   lt;welcome-filegt;     index.jsp   lt;/welcome-filegt; lt;/welcome-file-listgt;
lt;jsp-configgt;   lt;taglibgt;     lt;taglib-urigt;/springlt;/taglib-urigt;     lt;taglib-locationgt;/WEB-INF/tld/spring-form.tldlt;/taglib-locationgt;   lt;/taglibgt; lt;/jsp-configgt;

lt;/web-appgt;
Ale

Netbeans 6.0.1 + Tomcat 6.0.14 + jdk 1.6.05 + ubuntu 7.04 and 7.10

beans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)       at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)       at sun.reflect.GeneratedMethodAccessor371.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)       at java.lang.reflect.Method.invoke(Method.java:597)       at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)       at org.apache.tools.ant.Task.perform(Task.java:348)       at org.apache.tools.ant.Target.execute(Target.java:357)       at org.apache.tools.ant.Target.performTasks(Target.java:385)       at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)       at org.apache.tools.ant.Project.executeTarget(Project.java:1298)       at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)       at org.apache.tools.ant.Project.executeTargets(Project.java:1181)       at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)       at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)       at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: The module has not been deployed.       at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:157)       ... 16 more
BUILD FAILED (total time: 0 seconds)
Code:
5-apr-2008 23.36.47 org.apache.catalina.core.StandardContext preDeregister
GRAVE: error stopping
LifecycleException:  Pipeline has not been started       at org.apache.catalina.core.StandardPipeline.stop(StandardPipeline.java:257)       at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4517)       at org.apache.catalina.core.StandardContext.preDeregister(StandardContext.java:5235)       at org.apache.tomcat.util.modeler.BaseModelMBean.preDeregister(BaseModelMBean.java:1130)       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.preDeregisterInvoke(DefaultMBeanServerInterceptor.java:1048)       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:421)       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403)       at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506)       at org.apache.tomcat.util.modeler.Registry.unregisterComponent(Registry.java:574)       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4088)       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)       at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511)       at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
............You need to make sure that you have the Spring library jar file(s) within your deployment package. The error message tells you the Spring class ContextLoaderListener can't be found.


beans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

root cause

org..transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver
.........
root cause

org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver '
........
root cause

java.lang.ClassNotFoundException: org.postgresql.Driver
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
.........
The driver Postgresql is ok.

Code:
jdbc.properties
jdbc.driverClassName=org.postgresql.Driver
jdbc.ucl=jdbc:postgresql--127.0.0.1:5432/test
jdbc.username=postgres
jdbc.password=postgres

hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
Now i don't use hibernate but the example without dbcp is ok.


Originally Posted by alelinuxbsdThe driver Postgresql is ok.

root cause

java.lang.ClassNotFoundException: org.postgresql.Driver

What this error message tells you is that no PS driver is found. I think your environment is still not right.

mons.dbcp.BasicDataSourcequot;         p:driverClassName=quot;${jdbc.driverClassName}quot;         p:ucl=quot;${jdbc.ucl}quot;         p:username=quot;${jdbc.username}quot;         p:password=quot;${jdbc.password}quot; /gt;
don't function.
If i use:

Code:lt;bean id=quot;dataSourcequot;         class=quot;org.apache.commons.dbcp.BasicDataSourcequot;         destroy-method=quot;closequot;         p:driverClassName=quot;${jdbc.driverClassName}quot;         p:ucl=quot;${jdbc.ucl}quot;         p:username=quot;${jdbc.username}quot;         p:password=quot;${jdbc.password}quot; /gt;
don't function and also obtain an error on file.

Only in this form function:

Code:
lt;bean id=quot;dataSourcequot; class=quot;org.apache.commons.dbcp.BasicDataSourcequot; destroy-method=quot;closequot;gt;       lt;property name=quot;driverClassNamequot; value=quot;${jdbc.driverClassName}quot; /gt;       lt;property name=quot;uclquot; value=quot;${jdbc.ucl}quot; /gt;       lt;property name=quot;usernamequot; value=quot;${jdbc.username}quot; /gt;       lt;property name=quot;passwordquot; value=quot;${jdbc.password}quot; /gt;   lt;/beangt;
The first form function only with:
class=quot;org..jdbc.datasource.DriverM  anagerDataSourcequot;

Note:
I use postgresql in this example.
\web-inf\lib\postgresql-8.3-603.jdbc3.jar
I would like use tomcat.
Glassfish is never started on my platform.

I am now trying to use annotations in class InventoryController Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;beans xmlns=quot;schema/beansquot;      xmlns:xsi=quot;2001/XMLSchema-instancequot;      xmlns:p=quot;schema/pquot;      xmlns:aop=quot;schema/aopquot;      xmlns:tx=quot;schema/txquot;      xmlns:context=quot;schema/contextquot;      xsi:schemaLocation=quot;schema/beans       schema/beans/spring-beans-2.0.xsd      schema/aop schema/aop/spring-aop-2.0.xsd      schema/tx schema/tx/spring-tx-2.0.xsd      schema/context
schema/context/spring-context-2.5.xsdquot;gt;   lt;context:component-scan base-package=quot;springapp.webquot;/gt;      lt;bean class=quot;org..web.servlet.mvc.support.ControllerClassNameHandlerMappingquot;/gt;      lt;bean id=quot;uclMappingquot; class=quot;org..web.servlet.handler.SimpleuclHandlerMappingquot;gt;       lt;property name=quot;mappingsquot;gt;lt;propsgt;    lt;prop key=quot;/index.htmquot;gt;indexControllerlt;/propgt;    lt;!--lt;prop key=quot;/hello.htmquot;gt;InventoryControllerlt;/propgt;--gt;    lt;prop key=quot;/priceincrease.htmquot;gt;priceIncreaseFormlt;/propgt;lt;/propsgt;       lt;/propertygt;   lt;/beangt;         lt;bean name=quot;indexControllerquot;         class=quot;org..web.servlet.mvc.ParameterizableViewControllerquot;         p:viewName=quot;indexquot; /gt;      lt;!--   lt;bean name=quot;InventoryControllerquot; class=quot;springapp.web.InventoryControllerquot;gt;       lt;property name=quot;productManagerquot; ref=quot;productManagerquot;/gt;   lt;/beangt;   --gt;
InventoryController.java

Code:
package springapp.web;
...
import org..stereotype.Controller;
import org..beans.factory.annotation.Autowired;
import org..web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(quot;/hello.htmquot;)
......@Autowired   public void setProductManager(ProductManager productManager)
....Now remain these errors:

Code:
org..beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix quot;contextquot; for element quot;context:component-scanquot; is not bound.

Code:
org.xml.sax.SAXParseException: The prefix quot;contextquot; for element quot;context:component-scanquot; is not bound.
I'm also tried
...lt;context:annotation-config/gt;lt;context:component-scan base-package=quot;springapp.webquot;/gt;
...
but don't function.
If i leave only:lt;context:annotation-config/gt;
remain this error:
from Status 404 -

type Status report

message

description The requested resource () is not available.
Apache Tomcat/6.0.14

springapp.service.ProductManager

I have had
@Repository
on file java but nothing.
¥
Back Forum Reply New