3

I'm stuck trying to setup a DRBE project with Roo 1.3.1 current release. I setup the project within STS latest version on latest eclipse release also, all fresh new install to avoid conflicts. Then I setup via Roo shell the JPA, user, database, and password, and then I try to get the database schema. Roo complains about not having the proper jdbc driver and suggests to download it. I do it but unfortunately Roo is unable to install it due to some unmet dependencies with slf4j-nop and slf4j-api.

I have also tried to install does dependencies alone but they both have circular dependencies on each other rendering impossible the installation of the jdbc driver (at least for the moment)

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 really has not deployed anything or resolved dependencies. I'm in a loop where it asks me to install jdbc bundle each time I try to reverse engineer the database. It asks me to install the bundle. I do. It sais it has deployed the bundle, but it doesn't. I retry ... and so on.

If I launch an old 1.2.5.RELEASE Roo shell I happen to have installed it all works without even asking me to install any bundle on Roo (I guess I already did at some point in the past)

I have 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 it throws me an exception complaining about MalformedURLException because there is no protocol on the bundle 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 have also tried to clean .m2 folder just in case maven local repo had corrupted versions of something ... but with no luck. It now has release 1.7.5 of these slf4j libraries that Roo shell complains about and asks release 1.6.1

I have used Springsource and Roo in past projects to speed up my development but this is not at all speeding me ...

Thanks in advance to anyone willing to read this :)

NOTE: The only way that I could make it work was to manually download the jdbc driver from MySQL's website, uncompress it and push it to the Roo shell through osgi.

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

True I can work now but, was not Spring and Spring Roo a framework and tool to make our development cycle faster? Did I get something wrong? Is a jdbc connection so uncommon?

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

Leo Nomdedeu
  • 338
  • 2
  • 5

0 Answers0