Roo shell cannot install jdbc package due to slf4j dependencies

I am stuck trying to set up a DRBE project with the current Roo 1.3.1 version. I am setting up a project in the latest STS to the latest eclipse and also a fresh fresh install to avoid conflicts. Then I install via Roo the JPA wrapper, user, database and password and then I try to get the database schema. Roo complains about the lack of a proper jdbc driver and suggests downloading it. I do this, but unfortunately Roo cannot install it due to some unmet dependencies with slf4j-nop and slf4j-api.

I am also trying to install only dependencies, but they both have circular dependencies on each other making it impossible to install the jdbc driver (at least for now)

roo> jpa setup --provider HIBERNATE --database MYSQL
roo> database properties set --key database.url --value jdbc:mysql://localhost:3306/dbdb
roo> database properties set --key database.password --value $$$$
roo> database properties set --key database.username --value uuuu
roo> database reverse engineer --package ~.model --schema PUBLIC --includeNonPortableAttributes
Located add-on that may offer this JDBC driver
1 found, sorted by rank; T = trusted developer; R = Roo 1.3 compatible
ID T R DESCRIPTION -------------------------------------------------------------
01 Y Y 5.1.18.0001 #jdbcdriver driverclass:com.mysql.jdbc.Driver. This...
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
JDBC driver not available for 'com.mysql.jdbc.Driver'
roo> addon install id --searchResultId 01
roo> Target resource(s):
-------------------
   Spring Roo - Wrapping - mysql-connector-java (5.1.18.0001)

Required resource(s):
---------------------
slf4j-nop (1.6.1)
slf4j-api (1.6.1)

Deploying...
done.

      

But it didn't really deploy anything or resolve dependencies. I'm in a loop where it asks me to install the jdbc package every time I try to reverse engineer the database. He asks me to install the package. I do. This means that he deployed the package, but it is not. I repeat ... etc.

If I run the old Roo 1.2.5.RELEASE shell that I installed, it all works without even asking me to install any kit on Roo (I think I already did at some point in the past)

I also tried to install with osgi

roo> osgi obr url add --url http://spring-roo-repository.springsource.org/repository.xml
roo> osgi obr start --bundleSymbolicName org.springframework.roo.wrapping.mysql-connector-java

      

But this is throwing me an exception complaining about MalformedURLException because there is no protocol in the package name ...

org.osgi.framework.BundleException: Unable to cache bundle: org.springframework.roo.wrapping.mysql-connector-java
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2870)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:138)
    at org.apache.felix.gogo.command.Basic.start(Basic.java:724)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:234)
    at org.springframework.roo.felix.FelixDelegator.obrStart(FelixDelegator.java:167)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:47)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:325)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149)
    at org.springframework.roo.shell.eclipse.EclipseShell.executeCommand(EclipseShell.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:202)
    at org.springframework.ide.eclipse.core.java.ClassUtils.invokeMethod(ClassUtils.java:137)
    at org.springframework.ide.eclipse.core.java.ClassUtils.invokeMethod(ClassUtils.java:97)
    at org.springframework.roo.shell.eclipse.Bootstrap.execute(Bootstrap.java:90)
    at org.springframework.ide.eclipse.roo.ui.internal.RooShellTab$CommandJob.run(RooShellTab.java:588)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.net.MalformedURLException: no protocol: org.springframework.roo.wrapping.mysql-connector-java
    at java.net.URL.<init>(URL.java:586)
    at org.apache.felix.framework.util.SecureAction.createURL(SecureAction.java:254)
    at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:148)
    at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:77)
    at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:878)
    at org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
    at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
    at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2866)
    ... 38 more
java.net.MalformedURLException: no protocol: org.springframework.roo.wrapping.mysql-connector-java

      

I also tried to clean up the .m2 folder in case the maven local repo had corrupted versions of something ... but no luck. It now has version 1.7.5 of these slf4j libraries that the Roo shell complains about and requests version 1.6.1

I've used Springsource and Roo in past projects to speed up my development, but it doesn't speed me up at all ...

Thanks in advance to anyone who wants to read this :)

NOTE. The only way I could get it working is to manually download the jdbc driver from the MySQL site , unzip it and push to the Roo shell via osgi.

roo> osgi start --url file:///Users/..../Downloads/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar

      

True, now I can work, but not Spring and Spring Roo - is it a framework and a tool to speed up our development cycle? Is there something wrong with me? Is jdbc connection so unusual?

I still want to know if there is a better / simpler / automatic way to do this.

+3


source to share





All Articles