ArchiveOrangemail archive

JBoss JIRA notifications


jboss-jira.lists.jboss.org
(List home) (Recent threads) (124 other JBoss Community lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • High traffic list: 30+ messages per day
  • This list contains about 151,448 messages, beginning Jul 2006
  • 66 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

[JBoss JIRA] Created: (AS7-1974) Unable to access OSGI service (BundleContext) from WebApp (servlet / RestEasy) using AS 7.1.1 stack.

Ad
Nikhil Joshi (JIRA) 1317297960Thu, 29 Sep 2011 12:06:00 +0000 (UTC)
Unable to access OSGI service (BundleContext) from WebApp (servlet / RestEasy) using AS 7.1.1 stack.
----------------------------------------------------------------------------------------------------

                 Key: AS7-1974
                 URL: https://issues.jboss.org/browse/AS7-1974
             Project: Application Server 7
          Issue Type: Clarification
          Components: OSGi
    Affects Versions: 7.1.0.Alpha1
         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
            Reporter: Nikhil Joshi
            Assignee: Thomas Diesler


This is with reference to thread on community forum

http://community.jboss.org/thread/172622

I am trying to access a OSGI Bundle from a Web Application. Where getting following error.

12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
    at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
    at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Nikhil Joshi (JIRA) 1317298186Thu, 29 Sep 2011 12:09:46 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Nikhil Joshi updated AS7-1974:
------------------------------

    Attachment: OSGIWebClient.zip


To run the servlet I use following link.
  
http://localhost:8080/OSGIWebClient/simple> Unable to access OSGI service (BundleContext) from WebApp (servlet / RestEasy) using AS 7.1.1 stack.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Updated) (JIRA) 1317807380Wed, 05 Oct 2011 09:36:20 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Thomas Diesler updated AS7-1974:
--------------------------------

            Summary: Unable to access OSGI service (BundleContext) from RestEasy WebApp  (was: Unable to access OSGI service (BundleContext) from WebApp (servlet / RestEasy) using AS 7.1.1 stack.)
      Fix Version/s: 7.1.0.Beta1
    Forum Reference: http://community.jboss.org/thread/172622  (was: http://community.jboss.org/thread/172622)> Unable to access OSGI service (BundleContext) from RestEasy WebApp
> ------------------------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Updated) (JIRA) 1317887540Thu, 06 Oct 2011 07:52:20 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Thomas Diesler updated AS7-1974:--------------------------------

            Summary: Unable to access OSGI service from RESTEasy WebApp  (was: Unable to access OSGI service (BundleContext) from RestEasy WebApp)
    Forum Reference: http://community.jboss.org/thread/172622  (was: http://community.jboss.org/thread/172622)

    
> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Commented) (JIRA) 1317889641Thu, 06 Oct 2011 08:27:21 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]Thomas Diesler commented on AS7-1974:
-------------------------------------

The attached SimpleClientServlet is not a RESTEasy endpoint
                
> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Commented) (JIRA) 1317892826Thu, 06 Oct 2011 09:20:26 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]Thomas Diesler commented on AS7-1974:
-------------------------------------

Confirmed
                
> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Issue Comment Edited) (JIRA) 1317893000Thu, 06 Oct 2011 09:23:20 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ] 

Thomas Diesler edited comment on AS7-1974 at 10/6/11 5:23 AM:
--------------------------------------------------------------

Confirmed. Depends on AS7-2021
                
      was (Author: thomas.diesler):
    Confirmed> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Issue Comment Edited) (JIRA) 1317893119Thu, 06 Oct 2011 09:25:19 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ] 

Thomas Diesler edited comment on AS7-1974 at 10/6/11 5:23 AM:
--------------------------------------------------------------

Confirmed, depends on AS7-2021
                
      was (Author: thomas.diesler):
    Confirmed. Depends on AS7-2021> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Clarification
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Updated) (JIRA) 1317893241Thu, 06 Oct 2011 09:27:21 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Thomas Diesler updated AS7-1974:
--------------------------------

    Workaround Description: 
The BundleContext can be obtained from a BundleReference

{code}
    private BundleContext getBundleContextFromClass() {
        BundleReference bref = (BundleReference) ConfigurationAdmin.class.getClassLoader();
        Bundle bundle = bref.getBundle();
        if (bundle.getState() != Bundle.ACTIVE) {
            try {
                bundle.start();
            } catch (BundleException ex) {
                log.errorf(ex, "Cannot start bundle: %s", bundle);
            }
        }
        return bundle.getBundleContext();
    }
{code}

  was:
The BundleContext can be obtained from a BundleReference

    private BundleContext getBundleContextFromClass() {
        BundleReference bref = (BundleReference) ConfigurationAdmin.class.getClassLoader();
        Bundle bundle = bref.getBundle();
        if (bundle.getState() != Bundle.ACTIVE) {
            try {
                bundle.start();
            } catch (BundleException ex) {
                log.errorf(ex, "Cannot start bundle: %s", bundle);
            }
        }
        return bundle.getBundleContext();
    }


           Forum Reference: http://community.jboss.org/thread/172622  (was: http://community.jboss.org/thread/172622)> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Updated) (JIRA) 1317893243Thu, 06 Oct 2011 09:27:23 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Thomas Diesler updated AS7-1974:
--------------------------------

                Issue Type: Bug  (was: Clarification)
                  Workflow: GIT Pull Request workflow   (was: jira)
    Workaround Description: 
The BundleContext can be obtained from a BundleReference

    private BundleContext getBundleContextFromClass() {
        BundleReference bref = (BundleReference) ConfigurationAdmin.class.getClassLoader();
        Bundle bundle = bref.getBundle();
        if (bundle.getState() != Bundle.ACTIVE) {
            try {
                bundle.start();
            } catch (BundleException ex) {
                log.errorf(ex, "Cannot start bundle: %s", bundle);
            }
        }
        return bundle.getBundleContext();
    }

                Workaround: Workaround Exists> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Commented) (JIRA) 1317893839Thu, 06 Oct 2011 09:37:19 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ] 

Thomas Diesler commented on AS7-1974:-------------------------------------

Running org.jboss.as.testsuite.integration.osgi.jaxrs.RestEasyIntegrationTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.964 sec

                
> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Issue Comment Edited) (JIRA) 1317893960Thu, 06 Oct 2011 09:39:20 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ] 

Thomas Diesler edited comment on AS7-1974 at 10/6/11 5:37 AM:
--------------------------------------------------------------

Added test case using workaround

Running org.jboss.as.testsuite.integration.osgi.jaxrs.RestEasyIntegrationTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.964 sec

                
      was (Author: thomas.diesler):
    Running org.jboss.as.testsuite.integration.osgi.jaxrs.RestEasyIntegrationTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.964 sec> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Updated) (JIRA) 1317895520Thu, 06 Oct 2011 10:05:20 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Thomas Diesler updated AS7-1974:
--------------------------------

      Fix Version/s: 7.1.0.CR1
                         (was: 7.1.0.Beta1)
    Forum Reference: http://community.jboss.org/thread/172622  (was: http://community.jboss.org/thread/172622)> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.CR1
>
>         Attachments: OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Nikhil Joshi (Updated) (JIRA) 1318318580Tue, 11 Oct 2011 07:36:20 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]Nikhil Joshi updated AS7-1974:
------------------------------

    Attachment: MessageRestService.java

    
> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.CR1
>
>         Attachments: MessageRestService.java, OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Nikhil Joshi (Commented) (JIRA) 1318319070Tue, 11 Oct 2011 07:44:30 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ] 

Nikhil Joshi commented on AS7-1974:
-----------------------------------

I tried to use the workaround code getBundleContextFromClass()in attached RestEasy sample (MessageRestService.java)
It is throwing following exception at the line >> ConfigurationAdmin.class.getClassLoader();

java.lang.ClassCastException: org.jboss.modules.ModuleClassLoader cannot be cast to org.osgi.framework.BundleReference

I am trying this with 7.1.0 Alpha with following jars
org.osgi.compendium-4.2.0.jar
org.osgi.core-4.2.0.jar> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.CR1
>
>         Attachments: MessageRestService.java, OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Commented) (JIRA) 1318319659Tue, 11 Oct 2011 07:54:19 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]Thomas Diesler commented on AS7-1974:
-------------------------------------

It is fundamentally wrong to package the the core osgi jars with your webapp. Instead create appropriate dependencies on the modules that the AS provides. Have a look at how the [test case|https://github.com/tdiesler/jboss-as/commit/6...] does it
                
> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.CR1
>
>         Attachments: MessageRestService.java, OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Thomas Diesler (Updated) (JIRA) 1318341861Tue, 11 Oct 2011 14:04:21 +0000 (UTC)
[ https://issues.jboss.org/browse/AS7-1974?page... ]

Thomas Diesler updated AS7-1974:
--------------------------------

       Fix Version/s: 7.1.0.Beta1
                          (was: 7.1.0.CR1)
    Git Pull Request: https://github.com/jbossas/jboss-as/pull/396  (was: https://github.com/jbossas/jboss-as/pull/396)
     Forum Reference: http://community.jboss.org/thread/172622  (was: http://community.jboss.org/thread/172622)> Unable to access OSGI service from RESTEasy WebApp
> --------------------------------------------------
>
>                 Key: AS7-1974
>                 URL: https://issues.jboss.org/browse/AS7-1974
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 7.1.0.Alpha1
>         Environment: Using JBoss Developer Studio M3 on Windows 7. Server AS 7.0.0 final, 7.1.1 Alpha, EAP  6.0 (experimental) 
>            Reporter: Nikhil Joshi
>            Assignee: Thomas Diesler
>             Fix For: 7.1.0.Beta1
>
>         Attachments: MessageRestService.java, OSGIWebClient.zip
>
>
> This is with reference to thread on community forum
> http://community.jboss.org/thread/172622
> I am trying to access a OSGI Bundle from a Web Application. Where getting following error.
> 12:16:04,070 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyRestService].[SimpleClientServlet]] (http--127.0.0.1-8080-1) Allocate exception for servlet SimpleClientServlet: java.lang.IllegalArgumentException: Can not set org.osgi.framework.BundleContext field sample.SimpleClientServlet.context to org.jboss.osgi.framework.internal.SystemBundleContext
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) [:1.6.0_25]
>     at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source) [:1.6.0_25]
>     at java.lang.reflect.Field.set(Unknown Source) [:1.6.0_25]--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdmini...
For more information on JIRA, see: http://www.atlassian.com/software/jira
Ad
Home | About | Privacy