Felix run embedded in an applet.
The applet, and the jar it use, are all signed.
All the bundles used by felix are also signed.
Policy file is the standard java.policy file, so signed jars have all
permissions.
I've tryied to run the same code outside of the bundle, in the applet. The
problem is the same, so i guess it's not a felix problem.
Thanks for help!
Regards
Luca
2008/3/10, Karl Pauls <[EMAIL PROTECTED]>:
>
> Can you elaborate a bit about "even if my bundle have all permission"?
> You will have to give at least the framework all permission as well
> ... Maybe just post your policy file and your commandline.
>
> regards,
>
> Karl
>
> On Mon, Mar 10, 2008 at 5:54 PM, Luca Ballestin
>
> <[EMAIL PROTECTED]> wrote:
> > It works!
> >
> >
> > One problem left: even if my bundle have all permission, I get this
> > exception:
> >
> >
> > 17:47:58,465 WARN [Timer-2] [JmsSenderImpl]
> > it.necsy.voip.impl.message.JmsSenderImpl$1.run(): Catched an exception
> > creating queue objects
> > org.jboss.jms.exception.MessagingJMSException: Failed to invoke
> > at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(
> > DelegateSupport.java:271)
> > at
> >
> org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop
> > (ClientConnectionFactoryDelegate.java:187)
> > at
> >
> org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext
>
> >
> > (ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
> > at
> >
> org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate
> > (StateCreationAspect.java:83)
> > at
> >
> org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke
> > (StateCreationAspect0.java)
> > at
> >
> org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext
>
> >
> > (ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
> > at
> >
> org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate
> > (ClientConnectionFactoryDelegate.java)
> > at
> org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(
> > JBossConnectionFactory.java:205)
> > at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection
> (
> > JBossConnectionFactory.java:101)
> > at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection
> (
> > JBossConnectionFactory.java:95)
> > at it.necsy.voip.impl.message.JmsSenderImpl$1.run(JmsSenderImpl.java
> :73)
> >
> > at java.security.AccessController.doPrivileged(Native Method)
> > at it.necsy.voip.impl.message.JmsSenderImpl.connect(
> JmsSenderImpl.java
> > :69)
> > at it.necsy.voip.impl.message.MessageSender.connect(
> MessageSender.java
> > :61)
> > at it.necsy.voip.impl.message.MessageSender.access$0(
> MessageSender.java
> > :56)
> > at it.necsy.voip.impl.message.MessageSender$InitTimerTask.run(
> > MessageSender.java:163)
> > at java.util.TimerThread.mainLoop(Unknown Source)
> > at java.util.TimerThread.run(Unknown Source)
> > Caused by: java.security.AccessControlException: access denied (
> > java.util.PropertyPermission legacyParsing read)
> > at java.security.AccessControlContext.checkPermission(Unknown
> Source)
> > at java.security.AccessController.checkPermission(Unknown Source)
> > at java.lang.SecurityManager.checkPermission(Unknown Source)
> > at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
> > at java.lang.System.getProperty(Unknown Source)
> > at org.jboss.remoting.InvokerLocator.parse(InvokerLocator.java:203)
> > at org.jboss.remoting.InvokerLocator.<init>(InvokerLocator.java:193)
> > at org.jboss.jms.client.remoting.JMSRemotingConnection.<init>(
> > JMSRemotingConnection.java:259)
> > at
> >
> org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop
> > (ClientConnectionFactoryDelegate.java:152)
> > ... 16 more
> >
> >
> >
> >
> > 2008/3/10, Karl Pauls <[EMAIL PROTECTED]>:
> >
> >
> > >
> > > Try setting the contextclassloader to the classloader of your bundle
> i.e.,
> > >
> > > ClassLoader ccl = Thread.currentThread().getContextClassLoader();
> > > try
> > > {
> > > Thread.currentThread
> > > ().setContextClassLoader(getClass().getClassLoader());
> > >
> > > // do context init
> > > }
> > > finally
> > > {
> > > Thread.currentThread().setContextClassLoader(ccl);
> > > }
> > >
> > > That should do the trick.
> > >
> > > regards,
> > >
> > > Karl
> > >
> > >
> > > On Mon, Mar 10, 2008 at 4:13 PM, Luca Ballestin
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hi
> > > >
> > > > I'm trying to make a bundle that communicate with a jms server
> (jboss
> > > > messaging).
> > > >
> > > > I've builded a small stand-alone test client, and everything works
> > > fine.
> > > >
> > > > When I put all libraries and code in a bundle, i get the following
> > > > exception:
> > > >
> > > > javax.naming.NoInitialContextException: Cannot instantiate class:
> > > > org.jnp.interfaces.NamingContextFactory [Root exception is
> > > > java.lang.ClassNotFoundException:
> > > org/jnp/interfaces/NamingContextFactory]
> > > > at javax.naming.spi.NamingManager.getInitialContext(Unknown
> Source)
> > > > at javax.naming.InitialContext.getDefaultInitCtx(Unknown
> Source)
> > > > at javax.naming.InitialContext.init(Unknown Source)
> > > > at javax.naming.InitialContext.<init>(Unknown Source)
> > > > at it.necsy.voip.impl.message.JmsSenderImpl.<init>(
> > > JmsSenderImpl.java
> > > > :42)
> > > > at it.necsy.voip.impl.message.MessageActivator.start(
> > > > MessageActivator.java:135)
> > > > at org.apache.felix.framework.util.SecureAction$Actions.run(
> > > > SecureAction.java:869)
> > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > at org.apache.felix.framework.util.SecureAction.startActivator(
> > > > SecureAction.java:586)
> > > > at org.apache.felix.framework.Felix._startBundle(Felix.java
> :1535)
> > > > at org.apache.felix.framework.Felix.startBundle(Felix.java
> :1469)
> > > > at org.apache.felix.framework.Felix.setFrameworkStartLevel(
> > > Felix.java
> > > > :1064)
> > > > at org.apache.felix.framework.StartLevelImpl.run(
> StartLevelImpl.java
> > > > :258)
> > > > at java.lang.Thread.run(Unknown Source)
> > > > Caused by: java.lang.ClassNotFoundException:
> > > > org/jnp/interfaces/NamingContextFactory
> > > > at java.lang.Class.forName0(Native Method)
> > > > at java.lang.Class.forName(Unknown Source)
> > > > at com.sun.naming.internal.VersionHelper12.loadClass(Unknown
> Source)
> > > > ... 14 more
> > > >
> > > >
> > > > I've opened the bundle, and the class
> > > > org.jnp.interfaces.NamingContextFactory is in the rigth place.
> > > >
> > > >
> > > >
> > > >
> > > > The manifest is:
> > > >
> > > > Bundle-Activator: ####.MessageActivator
> > > > Bundle-Vendor: ####
> > > > Bundle-Version: 0.0.1
> > > > Import-Package: org.osgi.framework,
> > > > javax.naming.spi,
> > > > javax.naming
> > > > Export-Package: ####.message
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The code that throws the exception is
> > > >
> > > > try {
> > > > Hashtable<String, Object> env = new Hashtable<String,
> > > Object>();
> > > > env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "
> > > > org.jnp.interfaces.NamingContextFactory");
> > > > env.put(javax.naming.Context.URL_PKG_PREFIXES, "
> > > > org.jboss.naming:org.jnp.interfaces");
> > > > env.put(javax.naming.Context.PROVIDER_URL,
> > > > "jnp://localhost:1099");
> > > > initialContext = new InitialContext(env);
> > > > } catch (NamingException e) {
> > > > logger.error("Could not create JNDI API ",e);
> > > > }
> > > >
> > > >
> > > > Is something misplaced?
> > > >
> > > > If it is possible, i would like to keep the jms libraries inside
> of the
> > > > bundle.
> > > >
> > > > Thanks
> > > >
> > > > Luca
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > Karl Pauls
> > > [EMAIL PROTECTED]
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
>
>
>
> --
>
> Karl Pauls
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>