[JBoss JIRA] (FORGE-1745) Cannot handle Freemaker templates from a main
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1745?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III commented on FORGE-1745:
-------------------------------------------
This is due to the fact that FreemarkerTempate is unproxiable. (It does not have a default constructor) This is a design flaw in the FreemarkerTemplate class (should be an interface or provide a default constructor.)
> Cannot handle Freemaker templates from a main
> ---------------------------------------------
>
> Key: FORGE-1745
> URL: https://issues.jboss.org/browse/FORGE-1745
> Project: Forge
> Issue Type: Bug
> Components: Templates
> Affects Versions: 2.4.1.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> I want to process a Freemaker template from a main class. The full code is here (https://github.com/agoncal/agoncal-sample-forge/blob/master/03-template/s...) and this is an abstract :
> {code}
> private void doIt() throws IOException {
> Furnace furnace = startFurnace();
> try {
> ResourceFactory resourceFactory = furnace.getAddonRegistry().getServices(ResourceFactory.class).get();
> TemplateProcessorFactory factory = furnace.getAddonRegistry().getServices(TemplateProcessorFactory.class).get();
> Resource<URL> templateResource = resourceFactory.create(getClass().getResource("RestEndpoint.jv"));
> Template template = new FreemarkerTemplate(templateResource); // Mark this resource as a Freemarker template
> TemplateProcessor processor = factory.fromTemplate(template);
> Map<String, Object> params = new HashMap<String, Object>(); //Could be a POJO also.
> params.put("name", "JBoss Forge");
> String output = processor.process(params); // should return "Hello JBoss Forge".
> System.out.println(output);
> } finally {
> furnace.stop();
> }
> }
> {code}
> But I get the following error :
> {code}
> Exception in thread "main" org.jboss.forge.furnace.exception.ContainerException: Failed to create proxy for type [class org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate]
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:827)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:687)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceSingleParameterValue(ClassLoaderAdapterCallback.java:617)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceParameterValues(ClassLoaderAdapterCallback.java:489)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.access$100(ClassLoaderAdapterCallback.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$1.call(ClassLoaderAdapterCallback.java:92)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:71)
> at org.jboss.forge.addon.templates.TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.fromTemplate(TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.java)
> at org.agoncal.sample.forge.template.RestEndpoint.doIt(RestEndpoint.java:47)
> at org.agoncal.sample.forge.template.RestEndpoint.main(RestEndpoint.java:35)
> 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:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.InstantiationException: org.jboss.forge.addon.templates.Template_$$_javassist_840b9c34-f23e-4d1e-8a3e-14ff4dfc9c4e
> at java.lang.Class.newInstance(Class.java:359)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:785)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:707)
> ... 15 more
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1745) Cannot handle Freemaker templates from a main
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1745?page=com.atlassian.jira.plugin... ]
George Gastaldi edited comment on FORGE-1745 at 4/5/14 1:21 PM:
----------------------------------------------------------------
Nevermind, the pom.xml says it so. We'll investigate
was (Author: gastaldi):
Nevermind, the pom.xml sayd it so. We'll investigate
> Cannot handle Freemaker templates from a main
> ---------------------------------------------
>
> Key: FORGE-1745
> URL: https://issues.jboss.org/browse/FORGE-1745
> Project: Forge
> Issue Type: Bug
> Components: Templates
> Affects Versions: 2.4.1.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> I want to process a Freemaker template from a main class. The full code is here (https://github.com/agoncal/agoncal-sample-forge/blob/master/03-template/s...) and this is an abstract :
> {code}
> private void doIt() throws IOException {
> Furnace furnace = startFurnace();
> try {
> ResourceFactory resourceFactory = furnace.getAddonRegistry().getServices(ResourceFactory.class).get();
> TemplateProcessorFactory factory = furnace.getAddonRegistry().getServices(TemplateProcessorFactory.class).get();
> Resource<URL> templateResource = resourceFactory.create(getClass().getResource("RestEndpoint.jv"));
> Template template = new FreemarkerTemplate(templateResource); // Mark this resource as a Freemarker template
> TemplateProcessor processor = factory.fromTemplate(template);
> Map<String, Object> params = new HashMap<String, Object>(); //Could be a POJO also.
> params.put("name", "JBoss Forge");
> String output = processor.process(params); // should return "Hello JBoss Forge".
> System.out.println(output);
> } finally {
> furnace.stop();
> }
> }
> {code}
> But I get the following error :
> {code}
> Exception in thread "main" org.jboss.forge.furnace.exception.ContainerException: Failed to create proxy for type [class org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate]
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:827)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:687)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceSingleParameterValue(ClassLoaderAdapterCallback.java:617)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceParameterValues(ClassLoaderAdapterCallback.java:489)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.access$100(ClassLoaderAdapterCallback.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$1.call(ClassLoaderAdapterCallback.java:92)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:71)
> at org.jboss.forge.addon.templates.TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.fromTemplate(TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.java)
> at org.agoncal.sample.forge.template.RestEndpoint.doIt(RestEndpoint.java:47)
> at org.agoncal.sample.forge.template.RestEndpoint.main(RestEndpoint.java:35)
> 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:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.InstantiationException: org.jboss.forge.addon.templates.Template_$$_javassist_840b9c34-f23e-4d1e-8a3e-14ff4dfc9c4e
> at java.lang.Class.newInstance(Class.java:359)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:785)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:707)
> ... 15 more
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1745) Cannot handle Freemaker templates from a main
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1745?page=com.atlassian.jira.plugin... ]
George Gastaldi commented on FORGE-1745:
----------------------------------------
Nevermind, the pom.xml sayd it so. We'll investigate
> Cannot handle Freemaker templates from a main
> ---------------------------------------------
>
> Key: FORGE-1745
> URL: https://issues.jboss.org/browse/FORGE-1745
> Project: Forge
> Issue Type: Bug
> Components: Templates
> Affects Versions: 2.4.1.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> I want to process a Freemaker template from a main class. The full code is here (https://github.com/agoncal/agoncal-sample-forge/blob/master/03-template/s...) and this is an abstract :
> {code}
> private void doIt() throws IOException {
> Furnace furnace = startFurnace();
> try {
> ResourceFactory resourceFactory = furnace.getAddonRegistry().getServices(ResourceFactory.class).get();
> TemplateProcessorFactory factory = furnace.getAddonRegistry().getServices(TemplateProcessorFactory.class).get();
> Resource<URL> templateResource = resourceFactory.create(getClass().getResource("RestEndpoint.jv"));
> Template template = new FreemarkerTemplate(templateResource); // Mark this resource as a Freemarker template
> TemplateProcessor processor = factory.fromTemplate(template);
> Map<String, Object> params = new HashMap<String, Object>(); //Could be a POJO also.
> params.put("name", "JBoss Forge");
> String output = processor.process(params); // should return "Hello JBoss Forge".
> System.out.println(output);
> } finally {
> furnace.stop();
> }
> }
> {code}
> But I get the following error :
> {code}
> Exception in thread "main" org.jboss.forge.furnace.exception.ContainerException: Failed to create proxy for type [class org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate]
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:827)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:687)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceSingleParameterValue(ClassLoaderAdapterCallback.java:617)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceParameterValues(ClassLoaderAdapterCallback.java:489)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.access$100(ClassLoaderAdapterCallback.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$1.call(ClassLoaderAdapterCallback.java:92)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:71)
> at org.jboss.forge.addon.templates.TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.fromTemplate(TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.java)
> at org.agoncal.sample.forge.template.RestEndpoint.doIt(RestEndpoint.java:47)
> at org.agoncal.sample.forge.template.RestEndpoint.main(RestEndpoint.java:35)
> 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:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.InstantiationException: org.jboss.forge.addon.templates.Template_$$_javassist_840b9c34-f23e-4d1e-8a3e-14ff4dfc9c4e
> at java.lang.Class.newInstance(Class.java:359)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:785)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:707)
> ... 15 more
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1745) Cannot handle Freemaker templates from a main
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1745?page=com.atlassian.jira.plugin... ]
George Gastaldi commented on FORGE-1745:
----------------------------------------
Are you sure you are using 2.4.1.Final? We fixed that afaik
> Cannot handle Freemaker templates from a main
> ---------------------------------------------
>
> Key: FORGE-1745
> URL: https://issues.jboss.org/browse/FORGE-1745
> Project: Forge
> Issue Type: Bug
> Components: Templates
> Affects Versions: 2.4.1.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> I want to process a Freemaker template from a main class. The full code is here (https://github.com/agoncal/agoncal-sample-forge/blob/master/03-template/s...) and this is an abstract :
> {code}
> private void doIt() throws IOException {
> Furnace furnace = startFurnace();
> try {
> ResourceFactory resourceFactory = furnace.getAddonRegistry().getServices(ResourceFactory.class).get();
> TemplateProcessorFactory factory = furnace.getAddonRegistry().getServices(TemplateProcessorFactory.class).get();
> Resource<URL> templateResource = resourceFactory.create(getClass().getResource("RestEndpoint.jv"));
> Template template = new FreemarkerTemplate(templateResource); // Mark this resource as a Freemarker template
> TemplateProcessor processor = factory.fromTemplate(template);
> Map<String, Object> params = new HashMap<String, Object>(); //Could be a POJO also.
> params.put("name", "JBoss Forge");
> String output = processor.process(params); // should return "Hello JBoss Forge".
> System.out.println(output);
> } finally {
> furnace.stop();
> }
> }
> {code}
> But I get the following error :
> {code}
> Exception in thread "main" org.jboss.forge.furnace.exception.ContainerException: Failed to create proxy for type [class org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate]
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:827)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:687)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceSingleParameterValue(ClassLoaderAdapterCallback.java:617)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceParameterValues(ClassLoaderAdapterCallback.java:489)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.access$100(ClassLoaderAdapterCallback.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$1.call(ClassLoaderAdapterCallback.java:92)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:71)
> at org.jboss.forge.addon.templates.TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.fromTemplate(TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.java)
> at org.agoncal.sample.forge.template.RestEndpoint.doIt(RestEndpoint.java:47)
> at org.agoncal.sample.forge.template.RestEndpoint.main(RestEndpoint.java:35)
> 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:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.InstantiationException: org.jboss.forge.addon.templates.Template_$$_javassist_840b9c34-f23e-4d1e-8a3e-14ff4dfc9c4e
> at java.lang.Class.newInstance(Class.java:359)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:785)
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
> at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:707)
> ... 15 more
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1745) Cannot handle Freemaker templates from a main
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1745:
----------------------------------------
Summary: Cannot handle Freemaker templates from a main
Key: FORGE-1745
URL: https://issues.jboss.org/browse/FORGE-1745
Project: Forge
Issue Type: Bug
Components: Templates
Affects Versions: 2.4.1.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
I want to process a Freemaker template from a main class. The full code is here (https://github.com/agoncal/agoncal-sample-forge/blob/master/03-template/s...) and this is an abstract :
{code}
private void doIt() throws IOException {
Furnace furnace = startFurnace();
try {
ResourceFactory resourceFactory = furnace.getAddonRegistry().getServices(ResourceFactory.class).get();
TemplateProcessorFactory factory = furnace.getAddonRegistry().getServices(TemplateProcessorFactory.class).get();
Resource<URL> templateResource = resourceFactory.create(getClass().getResource("RestEndpoint.jv"));
Template template = new FreemarkerTemplate(templateResource); // Mark this resource as a Freemarker template
TemplateProcessor processor = factory.fromTemplate(template);
Map<String, Object> params = new HashMap<String, Object>(); //Could be a POJO also.
params.put("name", "JBoss Forge");
String output = processor.process(params); // should return "Hello JBoss Forge".
System.out.println(output);
} finally {
furnace.stop();
}
}
{code}
But I get the following error :
{code}
Exception in thread "main" org.jboss.forge.furnace.exception.ContainerException: Failed to create proxy for type [class org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate]
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:827)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:687)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceSingleParameterValue(ClassLoaderAdapterCallback.java:617)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhanceParameterValues(ClassLoaderAdapterCallback.java:489)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.access$100(ClassLoaderAdapterCallback.java:34)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$1.call(ClassLoaderAdapterCallback.java:92)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:71)
at org.jboss.forge.addon.templates.TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.fromTemplate(TemplateProcessorFactory_$$_javassist_381849cc-8aad-4339-adb9-66683e1ebbde.java)
at org.agoncal.sample.forge.template.RestEndpoint.doIt(RestEndpoint.java:47)
at org.agoncal.sample.forge.template.RestEndpoint.main(RestEndpoint.java:35)
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:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.InstantiationException: org.jboss.forge.addon.templates.Template_$$_javassist_840b9c34-f23e-4d1e-8a3e-14ff4dfc9c4e
at java.lang.Class.newInstance(Class.java:359)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:785)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.enhance(ClassLoaderAdapterCallback.java:707)
... 15 more
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1744) Cannot install AngularJS addon
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1744?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-1744.
----------------------------------
Assignee: George Gastaldi
Fix Version/s: (was: 2.x Future)
Resolution: Done
AngularJS addon updated to Forge 2.4.1.Final
> Cannot install AngularJS addon
> ------------------------------
>
> Key: FORGE-1744
> URL: https://issues.jboss.org/browse/FORGE-1744
> Project: Forge
> Issue Type: Bug
> Components: Addon Development
> Affects Versions: 2.4.1.Final
> Reporter: Antonio Goncalves
> Assignee: George Gastaldi
>
> I install the AngularJS from git as follow and I get an error :
> {code}
> [test]$ addon-git-install --url https://github.com/forge/angularjs-addon.git
> ***INFO*** Installing git addon [0/4] ...
> ***INFO*** Installing git addon:Cloning repository in /var/folders/ds/w5m7dxx91t98p0s19sjcv6_00000gn/T/1396716320262-0 [0/4] ...
> ***INFO*** Installing git addon:Installing project into local repository [1/4] ...
> ***ERROR*** Unable to execute project build
> [test]$
> {code}
> In the logs I get the following, which sounds like a Roaster version problem :
> {code}
> no suitable method found for getJavaResource(org.jboss.forge.roaster.model.source.JavaClassSource)
> method org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.getJavaResource(org.jboss.forge.parser.java.JavaSource<?>) is not applicable
> (actual argument org.jboss.forge.roaster.model.source.JavaClassSource cannot be converted to org.jboss.forge.parser.java.JavaSource<?> by method invocation conversion)
> method org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.getJavaResource(java.lang.String) is not applicable
> (actual argument org.jboss.forge.roaster.model.source.JavaClassSource cannot be converted to java.lang.String by method invocation conversion)
> 18:45:40,908 SEVERE [org.apache.maven.plugin.compiler.CompilerMojo] (AeshProcess: 4) /var/folders/ds/w5m7dxx91t98p0s19sjcv6_00000gn/T/1396716320262-0/src/main/java/org/jboss/forge/addon/angularjs/ScaffoldableEntitySelectionWizard.java:[91,14] no suitable method found for setValueChoices(java.util.List<org.jboss.forge.parser.java.JavaClass>)
> method org.jboss.forge.addon.ui.input.SelectComponent.setValueChoices(java.util.concurrent.Callable<java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource>>) is not applicable
> (actual argument java.util.List<org.jboss.forge.parser.java.JavaClass> cannot be converted to java.util.concurrent.Callable<java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource>> by method invocation conversion)
> method org.jboss.forge.addon.ui.input.SelectComponent.setValueChoices(java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource>) is not applicable
> (actual argument java.util.List<org.jboss.forge.parser.java.JavaClass> cannot be converted to java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource> by method invocation conversion)
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1671) Add nested annotation to a constraint annotation
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1671?page=com.atlassian.jira.plugin... ]
Antonio Goncalves commented on FORGE-1671:
------------------------------------------
Cool, it works with the new {{addNestedType}} type of Roaster 2.1. I just need a bit of time to send a pull request ;o)
{code}
public class BeanValidationAnnotation {
public static void main(String[] args) {
// This is the inner annotation List
final JavaAnnotationSource listAnnotation = Roaster.create(JavaAnnotationSource.class);
listAnnotation.setName("List");
listAnnotation.addAnnotation(Retention.class).setEnumValue(RUNTIME);
listAnnotation.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE);
listAnnotation.addAnnotationElement("Email[] value()");
// This is the annotation @Email
final JavaAnnotationSource emailAnnotation = Roaster.create(JavaAnnotationSource.class);
emailAnnotation.setPackage("org.agoncal.proj.constraints").setName("Email");
emailAnnotation.addImport(Payload.class);
emailAnnotation.addAnnotation(Documented.class);
emailAnnotation.addAnnotation(Retention.class).setEnumValue(RUNTIME);
emailAnnotation.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE);
emailAnnotation.addAnnotation(Constraint.class).setLiteralValue("validatedBy", "{}");
emailAnnotation.addAnnotationElement("String message() default \"wrong email address\"");
emailAnnotation.addAnnotationElement("Class<?>[] groups() default {}");
emailAnnotation.addAnnotationElement("Class<? extends Payload>[] payload() default {}");
emailAnnotation.addNestedType(listAnnotation);
System.out.println(emailAnnotation);
}
}
{code}
> Add nested annotation to a constraint annotation
> ------------------------------------------------
>
> Key: FORGE-1671
> URL: https://issues.jboss.org/browse/FORGE-1671
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE, Parsers / File Manipulation
> Affects Versions: 2.2.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> At the moment a constraint annotation does not contain a {{List}} of constraints. So, at the moment, the command {{constraint-new-annotation}} generates the following code :
> {code}
> @Documented
> @Constraint(validatedBy = {})
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @ReportAsSingleViolation
> public @interface URL {
> String message() default "Invalid value";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> {code}
> It should add a nested annotation {{List}} of type array of constraint
> {code}
> @Documented
> @Constraint(validatedBy = {})
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @ReportAsSingleViolation
> public @interface URL {
> String message() default "Invalid value";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @Documented
> public @interface List {
> URL[] value();
> }
> }
> {code}
> See class : {{NewAnnotationCommand}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1744) Cannot install AngularJS addon
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1744:
----------------------------------------
Summary: Cannot install AngularJS addon
Key: FORGE-1744
URL: https://issues.jboss.org/browse/FORGE-1744
Project: Forge
Issue Type: Bug
Components: Addon Development
Affects Versions: 2.4.1.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
I install the AngularJS from git as follow and I get an error :
{code}
[test]$ addon-git-install --url https://github.com/forge/angularjs-addon.git
***INFO*** Installing git addon [0/4] ...
***INFO*** Installing git addon:Cloning repository in /var/folders/ds/w5m7dxx91t98p0s19sjcv6_00000gn/T/1396716320262-0 [0/4] ...
***INFO*** Installing git addon:Installing project into local repository [1/4] ...
***ERROR*** Unable to execute project build
[test]$
{code}
In the logs I get the following, which sounds like a Roaster version problem :
{code}
no suitable method found for getJavaResource(org.jboss.forge.roaster.model.source.JavaClassSource)
method org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.getJavaResource(org.jboss.forge.parser.java.JavaSource<?>) is not applicable
(actual argument org.jboss.forge.roaster.model.source.JavaClassSource cannot be converted to org.jboss.forge.parser.java.JavaSource<?> by method invocation conversion)
method org.jboss.forge.addon.parser.java.facets.JavaSourceFacet.getJavaResource(java.lang.String) is not applicable
(actual argument org.jboss.forge.roaster.model.source.JavaClassSource cannot be converted to java.lang.String by method invocation conversion)
18:45:40,908 SEVERE [org.apache.maven.plugin.compiler.CompilerMojo] (AeshProcess: 4) /var/folders/ds/w5m7dxx91t98p0s19sjcv6_00000gn/T/1396716320262-0/src/main/java/org/jboss/forge/addon/angularjs/ScaffoldableEntitySelectionWizard.java:[91,14] no suitable method found for setValueChoices(java.util.List<org.jboss.forge.parser.java.JavaClass>)
method org.jboss.forge.addon.ui.input.SelectComponent.setValueChoices(java.util.concurrent.Callable<java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource>>) is not applicable
(actual argument java.util.List<org.jboss.forge.parser.java.JavaClass> cannot be converted to java.util.concurrent.Callable<java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource>> by method invocation conversion)
method org.jboss.forge.addon.ui.input.SelectComponent.setValueChoices(java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource>) is not applicable
(actual argument java.util.List<org.jboss.forge.parser.java.JavaClass> cannot be converted to java.lang.Iterable<org.jboss.forge.roaster.model.source.JavaClassSource> by method invocation conversion)
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (FORGE-1743) Rename addon-git-install command to addon-install-from-git
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1743:
----------------------------------------
Summary: Rename addon-git-install command to addon-install-from-git
Key: FORGE-1743
URL: https://issues.jboss.org/browse/FORGE-1743
Project: Forge
Issue Type: Feature Request
Components: UI - Shell
Affects Versions: 2.4.1.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
To follow the naming convention <topic>-<verb>, the command should be renamed :
{code}
addon-install-from-git
{code}
Makes it sound like the existing command :
{code}
rest-generate-endpoints-from-entities
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months