Search code examples
spring-roo

I can't add a new language to ROO 2.0.0.M3


Hi i have also a Problem with install new language.

Build an new message property file I have create language addon in roo shell with messages_de.properties.

addon create i18n --topLevelPackage org.springframework.roo.addon.web.mvc.i18n --locale de --messageBundle messages_de.properties

the i will create a jar with maven

mvn clean install

First Problem

Downloading: https://repo.maven.apache.org/maven2/org/springframework/roo/org.springframework.roo.ad
don.web.mvc.jsp/2.0.0.M3/org.springframework.roo.addon.web.mvc.jsp-2.0.0.M3.pom
[WARNING] The POM for org.springframework.roo:org.springframework.roo.addon.web.mvc.jsp:jar:2.0.0.M3
 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/org/springframework/roo/org.springframework.roo.ad
don.web.mvc.jsp/2.0.0.M3/org.springframework.roo.addon.web.mvc.jsp-2.0.0.M3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.043 s
[INFO] Finished at: 2017-03-02T07:08:50+01:00
[INFO] Final Memory: 12M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.springframework.roo.addon.web.mvc.i18n.languages: Coul
d not resolve dependencies for project org.springframework.roo.addon.web.mvc.i18n.languages:org.spri
ngframework.roo.addon.web.mvc.i18n.languages:bundle:0.1.0.BUILD-SNAPSHOT: Could not find artifact or
g.springframework.roo:org.springframework.roo.addon.web.mvc.jsp:jar:2.0.0.M3 in central (https://rep
o.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following arti
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

I show on maven repository and there is the jar only for ROO 2.0.0.M1 and i use M3 and then i change the pom.xml set

<dependency>
   <groupId>org.springframework.roo</groupId>
   <artifactId>org.springframework.roo.addon.web.mvc.jsp</artifactId>
   <version>2.0.0.M1</version>
</dependency>

The a jar was build.

i will install this jar as addon.

The jar i have copied in the folder where is start roo. I working on Windows. But the command not work

in roo shell type

I test addon install url --url file:\\org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD -SNAPSHOT.jar

stacktrace:

Illegal character in opaque part at index 5: file:\org.springframework.roo.addon.web.mvc.i18n.langua
ges-0.1.0.BUILD-SNAPSHOT.jar
java.lang.IllegalArgumentException: Illegal character in opaque part at index 5: file:\org.springfra
mework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at java.net.URI.create(Unknown Source)
    at java.net.URI.resolve(Unknown Source)
    at org.apache.felix.gogo.command.Util.resolveUri(Util.java:522)
    at org.apache.felix.gogo.command.Basic.install(Basic.java:433)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:110)
    at org.springframework.roo.felix.FelixDelegator.shell(FelixDelegator.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.obr.addon.search.ObrAddonSearchOperationsImpl.installAddOnByUrl(ObrAd
donSearchOperationsImpl.java:457)
    at org.springframework.roo.obr.addon.search.ObrAddOnCommands.installByUrl(ObrAddOnCommands.java:
46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:417)
    at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:547)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 5: file:\org.sprin
gframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at java.net.URI$Parser.fail(Unknown Source)
    at java.net.URI$Parser.checkChars(Unknown Source)
    at java.net.URI$Parser.parse(Unknown Source)
    at java.net.URI.<init>(Unknown Source)
    ... 43 more
org.osgi.framework.BundleException: Unable to cache bundle: file:\org.springframework.roo.addon.web.
mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2975)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:140)
    at org.apache.felix.gogo.command.Basic.start(Basic.java:734)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:110)
    at org.springframework.roo.felix.FelixDelegator.shell(FelixDelegator.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.obr.addon.search.ObrAddonSearchOperationsImpl.installAddOnByUrl(ObrAd
donSearchOperationsImpl.java:458)
    at org.springframework.roo.obr.addon.search.ObrAddOnCommands.installByUrl(ObrAddOnCommands.java:
46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:417)
    at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:547)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: \org.springframework.roo.addon.web.mvc.i18n.languages-0.1.
0.BUILD-SNAPSHOT.jar (Das System kann die angegebene Datei nicht finden)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:52
5)
    at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
    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:2971)
    ... 42 more
java.io.FileNotFoundException: \org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNA
PSHOT.jar (Das System kann die angegebene Datei nicht finden)

What is wrong why come file not found exception at the end ?

I test addon install url --url file://org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD -SNAPSHOT.jar

and get stacktrace:

java.io.IOException: Server returned HTTP response code: 503 for URL: ftp://org.springframework.roo.
addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar

org.osgi.framework.BundleException: Unable to cache bundle: file://org.springframework.roo.addon.web
.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2975)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:140)
    at org.apache.felix.gogo.command.Basic.start(Basic.java:734)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.springframework.roo.felix.FelixDelegator.perform(FelixDelegator.java:110)
    at org.springframework.roo.felix.FelixDelegator.shell(FelixDelegator.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.obr.addon.search.ObrAddonSearchOperationsImpl.installAddOnByUrl(ObrAd
donSearchOperationsImpl.java:458)
    at org.springframework.roo.obr.addon.search.ObrAddOnCommands.installByUrl(ObrAddOnCommands.java:
46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(Proc
essManagerHostedExecutionStrategy.java:48)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(Defa
ultProcessManager.java:307)
    at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcess
Manager.java:67)
    at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(Process
ManagerHostedExecutionStrategy.java:45)
    at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:306)
    at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:218)
    at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:417)
    at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:547)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: ftp://org.springfra
mework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
    at org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:52
5)
    at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
    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:2971)
    ... 42 more
java.io.IOException: Server returned HTTP response code: 503 for URL: ftp://org.springframework.roo.
addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPSHOT.jar

I think i can't do install addons with addon install url --url file:\... or with file://... file don't work in this command. I older Versions of Roo with osgi command i found examples with osgi start --url file:///foo.jar

http://docs.spring.io/spring-roo/reference/html/simple-addons.html

But osgi command not work or not found.

Another Problem i test to install with osgi command (like in older Versions from roo) but the osgi command not found.

i type

roo> help osgi

COMMAND INDEX


** Type 'hint' (without the quotes) and hit ENTER for step-by-step guidance **

roo> osgi start --url file:///org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-SNAPS
HOT.jar
Command 'osgi start --url file:///org.springframework.roo.addon.web.mvc.i18n.languages-0.1.0.BUILD-S
NAPSHOT.jar' not found (for assistance press TAB or type "hint" then hit ENTER)
Searching 'osgi start' on installed repositories
0 matches found with 'osgi start' on installed repositories

Another Test with language I have build language add on in same package structure like org.springframework.roo.addon.web.mvc.i18n-2.0.0.M3.jar and put the builded class, message properties and image for gramen in the jar where the other languages are present. This don't work the new language not show when i type web mvc language --code in an existing project.


Solution

  • Sorry for my delayed answer. I was checking your issue to know which is the problem.

    About the compilation problem, I've just solved it in the following commit.

    https://github.com/spring-projects/spring-roo/commit/2a332a991e16796c38180213d75666f41e6b1b86

    This fix will be included in the Spring Roo 2.0.0.RC1 version that will be released this week.

    About the installation process of a new .jar, you should use the following command:

    roo> addon install url --url file:///home/jcagarcia/.m2/repository/org/jcagarcia/i18n/de/org.jcagarcia.i18n.de/0.1.0.BUILD-SNAPSHOT/org.jcagarcia.i18n.de-0.1.0.BUILD-SNAPSHOT.jar
    Bundle ID: 92
    

    As you could see, the addon installation process is working correctly.

    Remember the following tips when you use this command:

    • Don't execute the Spring Roo shell under the same folder where you create the addon language.
    • You must to indicate the complete path to the .jar file
      • Linux path: file:///home/jcagarcia/.m2/repository/org/jcagarcia/i18n/de/org.jcagarcia.i18n.de/0.1.0.BUILD-SNAPSHOT/org.jcagarcia.i18n.de-0.1.0.BUILD-SNAPSHOT.jar
      • Windows path: file:///C://Users/jcagarcia/Desktop/org.jcagarcia.i18n.de-0.1.0.BUILD-SNAPSHOT.jar

    Hope it helps!