You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ed Kohlwey (JIRA)" <ji...@apache.org> on 2012/05/17 19:58:08 UTC

[jira] [Created] (AVRO-1094) Impossible to use non-default velocity templates

Ed Kohlwey created AVRO-1094:
--------------------------------

             Summary: Impossible to use non-default velocity templates
                 Key: AVRO-1094
                 URL: https://issues.apache.org/jira/browse/AVRO-1094
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.6.3, 1.6.2
            Reporter: Ed Kohlwey


It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.

This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.

I'll update this with a patch soon.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1094:
-------------------------------

    Fix Version/s: 1.7.0
    
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278339#comment-13278339 ] 

Doug Cutting commented on AVRO-1094:
------------------------------------

Your new patch fails for me with:

java.lang.NullPointerException
	at org.apache.avro.compiler.TestSpecificCompiler.getFilesystemPathForResource(TestSpecificCompiler.java:36)
	at org.apache.avro.compiler.TestSpecificCompiler.testCanReadTemplateFilesOnTheFilesystem(TestSpecificCompiler.java:43)

I test with 'mvn clean test' from the project root.  The CWD in Maven is the module's directory.  We rely on this in other tests and in the pom.xml files.  If I want to run just a specific test then I run 'mvn test -DTestName'.

I note that 'lang/java/avro' is missing from your project list.  Dunno if that's required.  I never use '-pl'.


                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Kohlwey updated AVRO-1094:
-----------------------------

    Attachment: AVRO-1094.patch
    
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>         Attachments: AVRO-1094.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Kohlwey updated AVRO-1094:
-----------------------------

    Status: Patch Available  (was: Open)
    
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3, 1.6.2
>            Reporter: Ed Kohlwey
>         Attachments: AVRO-1094.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278307#comment-13278307 ] 

Ed Kohlwey commented on AVRO-1094:
----------------------------------

Your patch doesn't work for me. How are you running it?

I'm using maven 3 installed from MacPorts on OSX and running the following from the Avro project root: 

mvn -pl .,lang/java/,lang/java/compiler,lang/java/maven-plugin test

It also works using the JUnit runner inside Eclipse 3.7 with m2e installed.

I think the notion of the CWD will vary based on where the maven command is actually executed (or Junit, if you're testing through eclipse).
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Kohlwey updated AVRO-1094:
-----------------------------

    Attachment: AVRO-1094.patch.2

Here's a better patch with a test included.
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>         Attachments: AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1094:
-------------------------------

    Resolution: Fixed
      Assignee: Ed Kohlwey
        Status: Resolved  (was: Patch Available)

I just committed this. Thanks, Ed!
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>            Assignee: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1094:
-------------------------------

    Attachment: AVRO-1094.patch

The test didn't work for me.  Here's a modified version that does.  Does this work for you too?

I'm hoping to make a 1.7.0 release soon.
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Kohlwey updated AVRO-1094:
-----------------------------

    Attachment: AVRO-1094.patch

Does this work a little better? It uses a little fancier class loader manipulation that should be robust in both environments.
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278388#comment-13278388 ] 

Ed Kohlwey commented on AVRO-1094:
----------------------------------

I just forgot the lang/java/avro when I was typing that in.

Doing an old fashioned "mvn clean test" works from the root with your first patch. +1
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>             Fix For: 1.7.0
>
>         Attachments: AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278038#comment-13278038 ] 

Doug Cutting commented on AVRO-1094:
------------------------------------

Patch looks good.  Should we add a test that uses this, so that someone doesn't inadvertently break this?
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>         Attachments: AVRO-1094.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AVRO-1094) Impossible to use non-default velocity templates

Posted by "Ed Kohlwey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278116#comment-13278116 ] 

Ed Kohlwey commented on AVRO-1094:
----------------------------------

Whats the chance of a 1.6.4 release with this included? Or is the 1.7 release planned fairly soon?
                
> Impossible to use non-default velocity templates
> ------------------------------------------------
>
>                 Key: AVRO-1094
>                 URL: https://issues.apache.org/jira/browse/AVRO-1094
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.2, 1.6.3
>            Reporter: Ed Kohlwey
>         Attachments: AVRO-1094.patch, AVRO-1094.patch.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It is effectively impossible to use a non-default velocity template for Avro compilation via the Maven plugin because the plugin's classloader only gives you access to its classpath and its dependencies classpath.
> This can be fixed by adding more resource loaders to Velocity in AvroCompiler.java.
> I'll update this with a patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira