I think you don't need Velocity for a Hello World application. You also
mentioned that you are a beginner ...
Just remove wicket-velocity.jar and velocity.jar from your app.


On Mon, Feb 18, 2013 at 1:37 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
>
> On Mon, Feb 18, 2013 at 12:28 PM, mike.hua <hz...@sohu.com> wrote:
>
> > Thanks a lot!
> > But now there are some errors in Tomcat server or GlassFish server.
> > *In Tomcat:*
> > Exception starting filter HelloWorldApplication
> > java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
> >         at
> >
> >
> org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:161)
> >         at
> >
> >
> org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:730)
> >         at
> >
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:263)
> >         at
> >
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646)
> >         at
> >
> >
> org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:226)
> >         at org.apache.velocity.app.Velocity.init(Velocity.java:97)
> >         at
> org.apache.wicket.velocity.Initializer.init(Initializer.java:61)
> >         at
> > org.apache.wicket.Application.initInitializers(Application.java:612)
> >         at
> > org.apache.wicket.Application.initializeComponents(Application.java:521)
> >         at
> > org.apache.wicket.Application.initApplication(Application.java:817)
> >         at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:409)
> >         at
> > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
> >         at
> >
> >
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
> >         at
> >
> >
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312)
> >         at
> > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> >         at
> >
> >
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> >         at
> >
> >
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> >         at
> > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> >         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> >         at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> >         at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> >         at java.lang.Thread.run(Thread.java:722)
> > Caused by: java.lang.ClassNotFoundException:
> > org.apache.commons.lang.StringUtils
> >         at
> >
> >
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
> >         at
> >
> >
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
> >
> >
> Those errors are not exactly wicket related... It is just that you are
> including jars that need other jars to function properly. Either you
> include those jar manually on class path (aka WEB-INF/lib) or your
> application start using some dependency management tool.
>
>
> > *In GlassFish server log:*
> > WebModule[/MyFirstWicket]PWC1270: Exception starting filter
> > HelloWorldApplication
> > java.lang.NoSuchMethodError:
> >
> >
> org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
> >         at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
> >         at
> > org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
> >         at
> > org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
> >         at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
> >         at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
> >         at
> >
> org.apache.wicket.protocol.http.WicketFilter.<clinit>(WicketFilter.java:64)
> >         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> >         at
> >
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> >         at
> >
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> >         at
> java.lang.reflect.Constructor.newInstance(Constructor.java:525)
> >         at
> >
> >
> com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
> >         at
> >
> >
> com.sun.enterprise.web.WebContainer.createFilterInstance(WebContainer.java:745)
> >         at
> >
> com.sun.enterprise.web.WebModule.createFilterInstance(WebModule.java:1972)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:253)
> >         at
> >
> >
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
> >         at
> >
> >
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
> >         at
> > org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
> >         at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
> >         at
> >
> >
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
> >         at
> > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
> >         at
> > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
> >         at
> > com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
> >         at
> > com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
> >         at
> > com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
> >         at
> org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
> >         at
> > org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
> >         at
> >
> org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
> >         at
> >
> >
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
> >         at
> >
> >
> com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
> >         at
> >
> >
> com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
> >         at
> >
> >
> com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
> >         at
> >
> >
> com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
> >         at
> >
> com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
> >         at
> >
> com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
> >         at
> >
> >
> com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
> >         at
> >
> >
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
> >         at
> >
> >
> com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
> >         at
> >
> >
> com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
> >         at
> >
> >
> com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
> >         at
> >
> >
> com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
> >         at
> >
> >
> com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
> >         at
> >
> >
> com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
> >         at
> >
> >
> com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >         at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >         at java.lang.reflect.Method.invoke(Method.java:601)
> >         at
> >
> >
> com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
> >         at
> > com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
> >
> >
> >
> You will probably need a newer version of failing jar.
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ <http://antiliasoft.com/antilia>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to