You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Eike Kettner (JIRA)" <ji...@apache.org> on 2010/10/03 22:46:33 UTC

[jira] Created: (WICKET-3088) "split-package" problem for wicket bundles started in an osgi container

"split-package" problem for wicket bundles started in an osgi container
-----------------------------------------------------------------------

                 Key: WICKET-3088
                 URL: https://issues.apache.org/jira/browse/WICKET-3088
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 1.5-M2.1
         Environment: Java 1.6.0_21-b06, wicket 1.5-M2.1,felix 3.0.2 (Linux (Ubuntu 32bit))
            Reporter: Eike Kettner


Referring to the thread in user mailing list: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-OSGi-td2847734.html

There is a problem when the wicket bundles are started in an osgi envirionment because of split packages

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


[jira] Commented: (WICKET-3088) "split-package" problem for wicket bundles started in an osgi container

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921812#action_12921812 ] 

Juergen Donnerstag commented on WICKET-3088:
--------------------------------------------

Copied from the mail chain. IMO a good explanation of the problem and offering a solution: unique package name per "project".

------------------------
I just had a look at the wicket packages of 1.4.12 and 1.5-M2.1 and I
found some differences. For example, wicket 1.5 has a new artifact
"wicket-request" and comparing the package structure there are some
changes, which are probably related to my problem:

wicket-1.4.12.jar:
org.apache
`-- wicket
    |-- authorization
    |   |-- Action.java
    |   |-- AuthorizationException.java
    |   |-- strategies
    |   |   |-- action
    |   |   |   |-- ActionAuthorizationStrategy.java
    |   |   |   `-- IActionAuthorizer.java
    |   |   |-- CompoundAuthorizationStrategy.java
    |   |   `-- page
    |   |       |-- AbstractPageAuthorizationStrategy.java
    |   |       `-- SimplePageAuthorizationStrategy.java
    |   |-- UnauthorizedActionException.java
    |   `-- UnauthorizedInstantiationException.java


wicket-auth-roles-1.4.12.jar:
org.apache
`-- wicket
   |-- authentication
   |   |-- AuthenticatedWebApplication.java
   |   |-- AuthenticatedWebSession.java
   |   |-- pages
   |   |   |-- SignInPage_fr.html
   `-- authorization
       `-- strategies
           `-- role
               |-- AbstractRoleAuthorizationStrategy.java
               |   |-- ActionPermissions.java
               `-- Roles.java

This looks good to OSGi as the classes are in disjoint packages in the
two bundles.


This changed in 1.5. There the structure looks like this:

wicket-1.5-M2.1.jar
org.apache
`-- wicket
    |-- authentication
    |   |-- IAuthenticationStrategy.java
    |   `-- strategy
    |       |-- DefaultAuthenticationStrategy.java
    |       `-- NoOpAuthenticationStrategy.java

wicket-auth-roles-1.5-M2.1.jar
org.apache
`-- wicket
    |-- authentication
    |   |-- AuthenticatedWebApplication.java
    |   |-- AuthenticatedWebSession.java
    |   |-- pages
    |   |   |-- SignInPage.html
    |   |   |-- SignInPage.java


The problem is the package org.apache.wicket.authentication now, because
the bundle wicket-1.5-M2.1 and wicket-auth-roles-1.5-M2.1 provide
classes from this package. The same refers to org.apache.wicket.request,
which is exported by wicket-request and wicket in 1.5. This leads to
problems in an OSGi environment. OSGi discourages those scenarios, but
still offers an solution for this. A (rather old) blog post on osgi.org
gives some hints on this:

http://www.osgi.org/blog/2006/04/misconceptions-about-osgi-headers.html

It probably gets to weird loading errors if two classes from the same
package want to access each others fields or methods with package access,
but come from a different classloader...

I'm no OSGi expert, so I don't know the right OSGi header that solves
this. Of course, a real solution would be to only have disjoint packages
:) I usually put the artifact name in my package name, to avoid any
clashes (in fact it makes sense in my module structure).


> "split-package" problem for wicket bundles started in an osgi container
> -----------------------------------------------------------------------
>
>                 Key: WICKET-3088
>                 URL: https://issues.apache.org/jira/browse/WICKET-3088
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M2.1
>         Environment: Java 1.6.0_21-b06, wicket 1.5-M2.1,felix 3.0.2 (Linux (Ubuntu 32bit))
>            Reporter: Eike Kettner
>            Priority: Trivial
>         Attachments: osgiquickstart.tar.gz
>
>
> Referring to the thread in user mailing list: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-OSGi-td2847734.html
> There is a problem when the wicket bundles are started in an osgi envirionment because of split packages

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


[jira] Updated: (WICKET-3088) "split-package" problem for wicket bundles started in an osgi container

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

Eike Kettner updated WICKET-3088:
---------------------------------

    Attachment: osgiquickstart.tar.gz

The "osgiquickstart.tar.gz" contains  a fresh osgi project built with pax-construct  (http://www.ops4j.org/projects/pax/construct/maven-pax-plugin/plugin-info.html).

quickstart:
1. unzip
2. cd into the new folder
3. mvn clean install pax:provision 

---

The pom.xml of the "provision" subproject contains all the dependencies that are loaded into OSGi container when using the pax:provision command.  I put all the wicket jars in there. If you go to the root pom you can set the wicket version. The easiest way to start the osgi container (afaik) is from command line using pax plugin:
  
      mvn clean install pax:provision

This starts up OSGi with a shell interface. You can see all bundles using

      felix:lb

command. 

The root pom contains the wicket.version property. If this is set to 1.4.x the OSGi container starts up fine with all wicket bundles active. If using 1.5-M2.1 it complains about unresolved packages (because of what I wrote in the mail).

Thank you!

> "split-package" problem for wicket bundles started in an osgi container
> -----------------------------------------------------------------------
>
>                 Key: WICKET-3088
>                 URL: https://issues.apache.org/jira/browse/WICKET-3088
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M2.1
>         Environment: Java 1.6.0_21-b06, wicket 1.5-M2.1,felix 3.0.2 (Linux (Ubuntu 32bit))
>            Reporter: Eike Kettner
>            Priority: Trivial
>         Attachments: osgiquickstart.tar.gz
>
>
> Referring to the thread in user mailing list: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-OSGi-td2847734.html
> There is a problem when the wicket bundles are started in an osgi envirionment because of split packages

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


[jira] Updated: (WICKET-3088) "split-package" problem for wicket bundles started in an osgi container

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

Juergen Donnerstag updated WICKET-3088:
---------------------------------------

    Priority: Major  (was: Trivial)

> "split-package" problem for wicket bundles started in an osgi container
> -----------------------------------------------------------------------
>
>                 Key: WICKET-3088
>                 URL: https://issues.apache.org/jira/browse/WICKET-3088
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M2.1
>         Environment: Java 1.6.0_21-b06, wicket 1.5-M2.1,felix 3.0.2 (Linux (Ubuntu 32bit))
>            Reporter: Eike Kettner
>         Attachments: osgiquickstart.tar.gz
>
>
> Referring to the thread in user mailing list: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-OSGi-td2847734.html
> There is a problem when the wicket bundles are started in an osgi envirionment because of split packages

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


[jira] Commented: (WICKET-3088) "split-package" problem for wicket bundles started in an osgi container

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920992#action_12920992 ] 

Igor Vaynberg commented on WICKET-3088:
---------------------------------------

can you provide a set of projects that reproduce this? hopefully maven managed with a simple StartThisBug class somewhere that starts up the container. none of us use osgi so setting up the environment will be the biggest problem. if we can run mvn eclipse:eclipse, import the projects into eclipse, and run StartThisBug we can start looking in the problem.

> "split-package" problem for wicket bundles started in an osgi container
> -----------------------------------------------------------------------
>
>                 Key: WICKET-3088
>                 URL: https://issues.apache.org/jira/browse/WICKET-3088
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M2.1
>         Environment: Java 1.6.0_21-b06, wicket 1.5-M2.1,felix 3.0.2 (Linux (Ubuntu 32bit))
>            Reporter: Eike Kettner
>
> Referring to the thread in user mailing list: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-OSGi-td2847734.html
> There is a problem when the wicket bundles are started in an osgi envirionment because of split packages

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


[jira] Updated: (WICKET-3088) "split-package" problem for wicket bundles started in an osgi container

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

Igor Vaynberg updated WICKET-3088:
----------------------------------

    Priority: Trivial  (was: Major)

> "split-package" problem for wicket bundles started in an osgi container
> -----------------------------------------------------------------------
>
>                 Key: WICKET-3088
>                 URL: https://issues.apache.org/jira/browse/WICKET-3088
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M2.1
>         Environment: Java 1.6.0_21-b06, wicket 1.5-M2.1,felix 3.0.2 (Linux (Ubuntu 32bit))
>            Reporter: Eike Kettner
>            Priority: Trivial
>
> Referring to the thread in user mailing list: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-OSGi-td2847734.html
> There is a problem when the wicket bundles are started in an osgi envirionment because of split packages

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