You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Willis Blackburn (JIRA)" <ji...@apache.org> on 2008/07/04 19:23:36 UTC

[jira] Created: (WICKET-1731) When used in inherited markup, tries to load a class with an illegal name

When used in inherited markup, <wicket:link> tries to load a class with an illegal name
---------------------------------------------------------------------------------------

                 Key: WICKET-1731
                 URL: https://issues.apache.org/jira/browse/WICKET-1731
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.4
         Environment: Mac OS X 10.4.11, Java 1.5.0_13, Tomcat 6.0.16
            Reporter: Willis Blackburn


Here are the classes involved.  Each one has a .html markup file.  The actual app is more complicated than this, but I've reduced it to a simple example.

myapp.TemplatePage: Page with standard header that is extended by all other pages.  Includes this autolink:

    <wicket:link><a href="HomePage.html">Home</a></wicket:link>

myapp.HomePage: Main page of the application.
myapp.login.LoginPage: Requests a user's login and password.

When I try to access LoginPage, I get a NoClassDefFoundError:  IllegalName: myapp/HomePage

I have determined why this is occurring.  AutoLinkResolver resolves autolinks to classes first by trying to load a class relative to the page's package, then relative to the parent page's package.  However, the first time it calls Packages.absolutePath, it passes the output to Strings.replaceAll to replace forward slashes with periods, while the second time, it doesn't, which leads to the IllegalName error.

The solution is to invoke the class-name-mangling logic from AutoLinkResolver.java lines 396-400 again after the call to Packages.absolutePath on line 428.

Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver.  It uses "if" instead of "while."  What if the autolink was two levels up in the inheritance hierarchy?  I think that it should walk the parent links until it finds a null, not just check the first one.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1731) When used in inherited markup, tries to load a class with an illegal name

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

Igor Vaynberg resolved WICKET-1731.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-M4
                   1.3.5

> When used in inherited markup, <wicket:link> tries to load a class with an illegal name
> ---------------------------------------------------------------------------------------
>
>                 Key: WICKET-1731
>                 URL: https://issues.apache.org/jira/browse/WICKET-1731
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Mac OS X 10.4.11, Java 1.5.0_13, Tomcat 6.0.16
>            Reporter: Willis Blackburn
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.5, 1.4-M4
>
>
> Here are the classes involved.  Each one has a .html markup file.  The actual app is more complicated than this, but I've reduced it to a simple example.
> myapp.TemplatePage: Page with standard header that is extended by all other pages.  Includes this autolink:
>     <wicket:link><a href="HomePage.html">Home</a></wicket:link>
> myapp.HomePage: Main page of the application.
> myapp.login.LoginPage: Requests a user's login and password.
> When I try to access LoginPage, I get a NoClassDefFoundError:  IllegalName: myapp/HomePage
> I have determined why this is occurring.  AutoLinkResolver resolves autolinks to classes first by trying to load a class relative to the page's package, then relative to the parent page's package.  However, the first time it calls Packages.absolutePath, it passes the output to Strings.replaceAll to replace forward slashes with periods, while the second time, it doesn't, which leads to the IllegalName error.
> The solution is to invoke the class-name-mangling logic from AutoLinkResolver.java lines 396-400 again after the call to Packages.absolutePath on line 428.
> Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver.  It uses "if" instead of "while."  What if the autolink was two levels up in the inheritance hierarchy?  I think that it should walk the parent links until it finds a null, not just check the first one.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1731) When used in inherited markup, tries to load a class with an illegal name

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

Igor Vaynberg reassigned WICKET-1731:
-------------------------------------

    Assignee: Igor Vaynberg

> When used in inherited markup, <wicket:link> tries to load a class with an illegal name
> ---------------------------------------------------------------------------------------
>
>                 Key: WICKET-1731
>                 URL: https://issues.apache.org/jira/browse/WICKET-1731
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Mac OS X 10.4.11, Java 1.5.0_13, Tomcat 6.0.16
>            Reporter: Willis Blackburn
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.5, 1.4-M4
>
>
> Here are the classes involved.  Each one has a .html markup file.  The actual app is more complicated than this, but I've reduced it to a simple example.
> myapp.TemplatePage: Page with standard header that is extended by all other pages.  Includes this autolink:
>     <wicket:link><a href="HomePage.html">Home</a></wicket:link>
> myapp.HomePage: Main page of the application.
> myapp.login.LoginPage: Requests a user's login and password.
> When I try to access LoginPage, I get a NoClassDefFoundError:  IllegalName: myapp/HomePage
> I have determined why this is occurring.  AutoLinkResolver resolves autolinks to classes first by trying to load a class relative to the page's package, then relative to the parent page's package.  However, the first time it calls Packages.absolutePath, it passes the output to Strings.replaceAll to replace forward slashes with periods, while the second time, it doesn't, which leads to the IllegalName error.
> The solution is to invoke the class-name-mangling logic from AutoLinkResolver.java lines 396-400 again after the call to Packages.absolutePath on line 428.
> Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver.  It uses "if" instead of "while."  What if the autolink was two levels up in the inheritance hierarchy?  I think that it should walk the parent links until it finds a null, not just check the first one.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1731) When used in inherited markup, tries to load a class with an illegal name

Posted by "Roland Huss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613277#action_12613277 ] 

Roland Huss commented on WICKET-1731:
-------------------------------------

WICKET-1634 is the same issue (including a patch), so this one can be closed, too

> When used in inherited markup, <wicket:link> tries to load a class with an illegal name
> ---------------------------------------------------------------------------------------
>
>                 Key: WICKET-1731
>                 URL: https://issues.apache.org/jira/browse/WICKET-1731
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Mac OS X 10.4.11, Java 1.5.0_13, Tomcat 6.0.16
>            Reporter: Willis Blackburn
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.5, 1.4-M4
>
>
> Here are the classes involved.  Each one has a .html markup file.  The actual app is more complicated than this, but I've reduced it to a simple example.
> myapp.TemplatePage: Page with standard header that is extended by all other pages.  Includes this autolink:
>     <wicket:link><a href="HomePage.html">Home</a></wicket:link>
> myapp.HomePage: Main page of the application.
> myapp.login.LoginPage: Requests a user's login and password.
> When I try to access LoginPage, I get a NoClassDefFoundError:  IllegalName: myapp/HomePage
> I have determined why this is occurring.  AutoLinkResolver resolves autolinks to classes first by trying to load a class relative to the page's package, then relative to the parent page's package.  However, the first time it calls Packages.absolutePath, it passes the output to Strings.replaceAll to replace forward slashes with periods, while the second time, it doesn't, which leads to the IllegalName error.
> The solution is to invoke the class-name-mangling logic from AutoLinkResolver.java lines 396-400 again after the call to Packages.absolutePath on line 428.
> Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver.  It uses "if" instead of "while."  What if the autolink was two levels up in the inheritance hierarchy?  I think that it should walk the parent links until it finds a null, not just check the first one.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1731) When used in inherited markup, tries to load a class with an illegal name

Posted by "Willis Blackburn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613497#action_12613497 ] 

Willis Blackburn commented on WICKET-1731:
------------------------------------------

How about my comment at the end?

"Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver. It uses 'if' instead of 'while.' What if the autolink was two levels up in the inheritance hierarchy? I think that it should walk the parent links until it finds a null, not just check the first one."




> When used in inherited markup, <wicket:link> tries to load a class with an illegal name
> ---------------------------------------------------------------------------------------
>
>                 Key: WICKET-1731
>                 URL: https://issues.apache.org/jira/browse/WICKET-1731
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Mac OS X 10.4.11, Java 1.5.0_13, Tomcat 6.0.16
>            Reporter: Willis Blackburn
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.5, 1.4-M4
>
>
> Here are the classes involved.  Each one has a .html markup file.  The actual app is more complicated than this, but I've reduced it to a simple example.
> myapp.TemplatePage: Page with standard header that is extended by all other pages.  Includes this autolink:
>     <wicket:link><a href="HomePage.html">Home</a></wicket:link>
> myapp.HomePage: Main page of the application.
> myapp.login.LoginPage: Requests a user's login and password.
> When I try to access LoginPage, I get a NoClassDefFoundError:  IllegalName: myapp/HomePage
> I have determined why this is occurring.  AutoLinkResolver resolves autolinks to classes first by trying to load a class relative to the page's package, then relative to the parent page's package.  However, the first time it calls Packages.absolutePath, it passes the output to Strings.replaceAll to replace forward slashes with periods, while the second time, it doesn't, which leads to the IllegalName error.
> The solution is to invoke the class-name-mangling logic from AutoLinkResolver.java lines 396-400 again after the call to Packages.absolutePath on line 428.
> Also, I'm suspicious of the logic for handling parent markup containers in AutoLinkResolver.  It uses "if" instead of "while."  What if the autolink was two levels up in the inheritance hierarchy?  I think that it should walk the parent links until it finds a null, not just check the first one.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.