Page 1 of 2

gwt error while doing a maven build 1.5

Posted: Wed Jul 27, 2011 5:23 am
by om.singh
I am trying to setup my own commerce store on top 1.5 demo store.

I took the concept from the [url]http://www.broadleafcommerce.org/confluence/display/BLC15/Eclipse+-+Maven[url]] url

When I start my jetty server - I am getting the exception below. I tried to resolve this by adding slf4j-api 1.6.1 in the broadleaf-open-admin-platform project pom from where it was trying to derive, but still get the error.

Code: Select all

2011-07-27 11:46:35.171:WARN::failed ContextHandlerCollection@185c2a25: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
2011-07-27 11:46:35.172:WARN::failed HandlerCollection@4ad2efa1: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
2011-07-27 11:46:35.172:WARN::Error starting handlers
java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
   at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:57)
   at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
   at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
   at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
   at org.springframework.util.PropertyPlaceholderHelper.<clinit>(PropertyPlaceholderHelper.java:40)
   at org.springframework.util.SystemPropertyUtils.<clinit>(SystemPropertyUtils.java:49)
   at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:129)
   at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
   at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
   at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
   at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
   at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
   at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
   at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
   at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
   at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
   at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
   at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
   at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
   at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
   at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
   at org.mortbay.jetty.Server.doStart(Server.java:224)
   at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
   at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
   at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
   at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
   at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
   at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
   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:597)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[INFO] Started Jetty Server
2011-07-27 11:46:35.200:INFO::Started SelectChannelConnector@0.0.0.0:8080
[INFO] Starting scanner at interval of 10 seconds.



In case you have any suggestion, please let me know

Regards
Om

Re: Conflicting slf4j jar file

Posted: Wed Jul 27, 2011 9:05 am
by om.singh
i have noticed that the war lib directory has a slf4j-api jar of version 1.3.1 and also 1.6.1. This is parhaps causing the error, but am not sure where the 1.3.1 version is coming from.

Re: Conflicting slf4j jar file

Posted: Wed Jul 27, 2011 11:07 am
by jefffischer
You should be able to use this attachment as an example of the best way to extend and implement the Broadleaf Commerce Framework version 1.5. Note, this example contains little to no GUI (there's a bare bones product browsing and cart page). It's intention is to demonstrate configuration and to use as a starting point. The admin site is fully functional.

Some key points if you want to run the example:

1) You need to execute mvn install at the root of the ecommerce directory to build the whole multi-module project
2) site-admin/build.xml includes some startup ant tasks. "start-db" launches a local HSQL database instance. "jetty-demo" launches the admin site. You can access it, once started, at http://localhost:8081/admin/admin.html
1) site/build.xml includes some startup ant tasks. "jetty-demo" launches the e-commerce site. You can access it, once started, at http://localhost:8080/mycompany/product.htm

ecommerce.zip
(1.15 MiB) Downloaded 2997 times

Re: Conflicting slf4j jar file

Posted: Thu Jul 28, 2011 2:48 am
by om.singh
Thanks a lot.

I was able to resolve the slf4j jar issue - actually i had not deleted the web/lib content of my new project which was holding to a 1.3.1 version. After doing a clean install - the store application started working fine.

I started facing issue with admin application as it was not loading the gwt module correctly.

Now that you have shared the admin working, i will try to make it work.

Regards
Om

gwt error while doing a maven build 1.5

Posted: Thu Jul 28, 2011 6:16 am
by om.singh
the code which you shared works fine.

In case you get some time to answer - I am still trying to make the previous application work and duing mvn install i am getting the exception below

Code: Select all

[INFO] snapshot org.broadleafcommerce:broadleaf-usps-schemas:1.5.0-M2-SNAPSHOT: checking for updates from com.anasoft.os.repository.releases
[INFO] snapshot org.broadleafcommerce:broadleaf-usps-schemas:1.5.0-M2-SNAPSHOT: checking for updates from third party releases
[INFO] snapshot org.broadleafcommerce:broadleaf-usps-schemas:1.5.0-M2-SNAPSHOT: checking for updates from jboss
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 5 source files to C:\projects\techshila\repository\codegreen\target\codegreen\WEB-INF\classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\projects\techshila\repository\codegreen\src\test\resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [gwt:compile {execution: default}]
[INFO] Compiling module org.broadleafcommerce.gwt.demoAdmin
[INFO]    Validating newly compiled units
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/event/shared
/EventBus.java'
[INFO]          [ERROR] Line 24: No source code is available for type com.google.web.bindery.event.shared.EventBus; did you forget to inherit a requir
ed module?
[INFO]          [ERROR] Line 28: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inher
it a required module?
[INFO]          [ERROR] Line 28: No source code is available for type com.google.web.bindery.event.shared.Event<H>.Type<H>; did you forget to inherit
a required module?
[INFO]          [ERROR] Line 48: No source code is available for type com.google.web.bindery.event.shared.Event<H>; did you forget to inherit a requir
ed module?
[INFO]          [ERROR] Line 68: Cannot cast from GwtEvent<capture#1-of ?> to Event<?>
[INFO]          [ERROR] Line 69: No source code is available for type com.google.web.bindery.event.shared.UmbrellaException; did you forget to inherit
 a required module?
[INFO]          [ERROR] Line 76: Cannot cast from GwtEvent<capture#3-of ?> to Event<?>
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/event/shared
/LegacyHandlerWrapper.java'
[INFO]          [ERROR] Line 19: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inher
it a required module?
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/event/shared
/ResettableEventBus.java'
[INFO]          [ERROR] Line 27: No source code is available for type com.google.web.bindery.event.shared.ResettableEventBus; did you forget to inheri
t a required module?
[INFO]          [ERROR] Line 49: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
[INFO]          [ERROR] Line 49: No source code is available for type com.google.web.bindery.event.shared.Event<H>.Type<H>; did you forget to inherit
a required module?
[INFO]          [ERROR] Line 53: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inher
it a required module?
[INFO]          [ERROR] Line 59: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
[INFO]          [ERROR] Line 68: No source code is available for type com.google.web.bindery.event.shared.Event<H>; did you forget to inherit a requir
ed module?
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/event/shared
/SimpleEventBus.java'
[INFO]          [ERROR] Line 27: No source code is available for type com.google.web.bindery.event.shared.SimpleEventBus; did you forget to inherit a
required module?
[INFO]          [ERROR] Line 32: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
[INFO]          [ERROR] Line 32: No source code is available for type com.google.web.bindery.event.shared.Event<H>.Type<H>; did you forget to inherit
a required module?
[INFO]          [ERROR] Line 36: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inher
it a required module?
[INFO]          [ERROR] Line 42: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
[INFO]          [ERROR] Line 51: No source code is available for type com.google.web.bindery.event.shared.Event<H>; did you forget to inherit a requir
ed module?
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/event/shared
/UmbrellaException.java'
[INFO]          [ERROR] Line 24: No source code is available for type com.google.web.bindery.event.shared.UmbrellaException; did you forget to inherit
 a required module?
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/event/shared
/testing/CountingEventBus.java'
[INFO]          [ERROR] Line 29: No source code is available for type com.google.web.bindery.event.shared.testing.CountingEventBus; did you forget to
inherit a required module?
[INFO]          [ERROR] Line 41: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
[INFO]          [ERROR] Line 41: No source code is available for type com.google.web.bindery.event.shared.Event<H>.Type<H>; did you forget to inherit
a required module?
[INFO]          [ERROR] Line 45: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inher
it a required module?
[INFO]          [ERROR] Line 51: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
[INFO]          [ERROR] Line 60: No source code is available for type com.google.web.bindery.event.shared.Event<H>; did you forget to inherit a requir
ed module?
[INFO]          [ERROR] Line 80: The method getCount(Event.Type<?>) in the type CountingEventBus is not applicable for the arguments (GwtEvent.Type<ca
pture#5-of ?>)
[INFO]    [ERROR] Errors in 'jar:file:/C:/Users/osingh/.m2/repository/org/broadleafcommerce/broadleaf-open-admin-platform/1.5.0-M2-SNAPSHOT/broadleaf-
open-admin-platform-1.5.0-M2-SNAPSHOT-sources.jar!/org/broadleafcommerce/gwt/client/service/AppServices.java'
[INFO]       [ERROR]  Internal compiler error
[INFO] java.lang.IllegalAccessError: tried to access method com.google.gwt.dev.util.DiskCache.<init>()V from class com.google.gwt.user.linker.rpc.RpcL
ogArtifact
[INFO]  at com.google.gwt.user.linker.rpc.RpcLogArtifact.<clinit>(RpcLogArtifact.java:40)
[INFO]  at com.google.gwt.user.rebind.rpc.ProxyCreator.create(ProxyCreator.java:365)
[INFO]  at com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator.generateIncrementally(ServiceInterfaceProxyGenerator.java:59)
[INFO]  at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:681)
[INFO]  at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:285)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:274)
[INFO]  at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
[INFO]  at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:251)
[INFO]  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:170)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:285)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:587)
[INFO]  at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
[INFO]  at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:525)
[INFO]  at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:538)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:492)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:405)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:215)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:187)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:166)
[INFO]
[INFO] [ERROR] Unexpected
[INFO] java.lang.IllegalAccessError: tried to access method com.google.gwt.dev.util.DiskCache.<init>()V from class com.google.gwt.user.linker.rpc.RpcL
ogArtifact
[INFO]  at com.google.gwt.user.linker.rpc.RpcLogArtifact.<clinit>(RpcLogArtifact.java:40)
[INFO]  at com.google.gwt.user.rebind.rpc.ProxyCreator.create(ProxyCreator.java:365)
[INFO]  at com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator.generateIncrementally(ServiceInterfaceProxyGenerator.java:59)
[INFO]  at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:681)
[INFO]  at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:285)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:274)
[INFO]  at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
[INFO]  at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:251)
[INFO]  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:170)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:285)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)
[INFO]  at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:587)
[INFO]  at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
[INFO]  at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:525)
[INFO]  at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:538)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:492)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:405)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:215)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:187)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:166)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR


I have looked at other google posting but of not great help.

Re: Conflicting slf4j jar file

Posted: Thu Jul 28, 2011 9:22 am
by jefffischer
It looks like there's a problem with one of your *.gwt.xml files. Compare whatever *.gwt.xml files you have in your application with the ones provided in the sample project.

gwt error while doing a maven build 1.5

Posted: Thu Jul 28, 2011 12:46 pm
by om.singh
The approach which I took - is to just copy the content of site - BroadleafCommerceDemo to mycommerce project and then execute the mvn install. If i remove the plugin to generate the admin awt package - it compliles all well the the store application also works fine.

Only when I include the plugin to generate the <module>org.broadleafcommerce.gwt.demoAdmin</module> it gives this error. As every thing else it same - have not introduced any new *.gwt.xml file - its all same from the 1.5 demo application.

I will continue to debug and see whats going wrong. In case you have any pointed please share.

Regards
Om

Re: gwt error while doing a maven build 1.5

Posted: Thu Jul 28, 2011 4:10 pm
by om.singh
I was able to resolve the issue. I was not using the parent project to kick off the compilation where there were other dependencies required for the gwt. Its compiling without any error now.

The store application works fine and also comes up with right data in the pages

when i access the admin login page
1. it does not render the correct login box - its missing the gwt decoration. only the user id and password box is displayed. On supplying the user id and password it loads a black page.

I saw an earlier post around this issue - have tried it several times but not able to get over this.

Re: gwt error while doing a maven build 1.5

Posted: Thu Aug 04, 2011 1:59 pm
by om.singh
Just making sure to clean every thing in elcipse project helped me over come the problem

Re: gwt error while doing a maven build 1.5

Posted: Sun Sep 04, 2011 9:47 am
by om.singh
import org.broadleafcommerce.gwt.client.datasource.DataSourceFactory; package has changed in the M3 snapshot.

The ecommerce.zip package is not working any more as admin module does not complie.