hello?

seems to be a bug in DefaultComponentModel and DefaultContainmentModel.
they both shadow the m_context field of DefaultDeploymentModel!

/eike


"Eike Stepper" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
> hi,
>
> i get a NPE somewhere in avalon when i for example:
>
>   protected Connector createConnector(SocketChannel socketChannel)
>   {
>     try
>     {
>       String componentName = "server-" + connectionManager.getUniqueId();
>       String componentType = PassiveSocketConnector.class.getName();
>       ComponentProfile profile = new ComponentProfile(componentName, componentType);
>
>       ComponentModel component = (ComponentModel) model.addModel(profile); // 
> <============== NPE !!!
>       component.getContextModel().setEntry("socketChannel", socketChannel);
>       component.commission();
>
>       Connector connector = (Connector) component.resolve();
>       connectionManager.register(connector);
>       return connector;
>     }
>     catch (Exception ex)
>     {
>       ex.printStackTrace();
>       return null;
>     }
>   }
>
> or:
>
>   public Channel addChannel(Protocol protocol)
>   {
>     try
>     {
>       short channelId = findFreeChannelId();
>       String componentName = toString() + "-channel-" + channelId;
>       String componentType = DefaultChannel.class.getName();
>       ComponentProfile profile = new ComponentProfile(componentName, componentType);
>
>       ComponentModel component = (ComponentModel) model.addModel(profile); // 
> <============== NPE !!!
>       component.getContextModel().setEntry("channelId", new Short(channelId));
>       component.getContextModel().setEntry("connector", this);
>       component.getContextModel().setEntry("protocol", protocol);
>       component.commission();
>
>       Channel channel = (Channel) component.resolve();
>       channels.set(channelId, channel);
>       return channel;
>     }
>     catch (Exception ex)
>     {
>       ex.printStackTrace();
>       return null;
>     }
>   }
>
> hmm, what is wrong here?
> i've also attached the log with the exceptions and audit.
>
> btw. a NPE is not that nice anyway...
>
> please help
> /eike
>
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to