Ideally, you can define the dependencies in the pom.xml and run "mvn eclipse:eclipse" to create eclipse meta files such as ".project", ".classpath".

Thanks,
Raymond

----- Original Message ----- From: "Rashmi Hunt" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, June 01, 2006 8:06 AM
Subject: Re: "ConfigurationLoadException: Unrecognized element .............." for a new binding type


Thanks for the quick response.
1) My loaded did register qualified name for the binding with the Stax
loader registry.
2) And my loaded class is MODULE scoped

I figured out what the problem is, which is not related to
code/implementation. It's eclipse....
I have eclipse workspace for Tuscany (all projects including my new binding
project)
and I run my test module project from eclipse as well. The test module
project didn't have
project dependency on my new binding project. It never gave me a compilation
error  because the reference to new binding is in sca.module file only
(which is XML).

When I add my new binding project as a project dependcy to my test module
project,
I don't see this this error anymore when I create a new TuscanyRuntime. I
think when
the new binding project is in test project's classpath, Tuscany runtime is
able to find the
system.fragment file and load the new binding accordningly... that's my
theory :-)

Regards
Rashmi



On 6/1/06, Meeraj Kunnumpurath <[EMAIL PROTECTED]> wrote:

This is from the spaces binding I have been working on,

/**
*
* Copyright 2006 The Apache Software Foundation
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package org.apache.tuscany.binding.spaces.loader;

import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader;

import org.apache.tuscany.binding.spaces.assembly.SpacesBinding;
import org.apache.tuscany.core.loader.LoaderContext;
import org.apache.tuscany.core.loader.StAXElementLoader;
import org.apache.tuscany.core.loader.StAXLoaderRegistry;
import org.apache.tuscany.core.system.annotation.Autowire;
import org.osoa.sca.annotations.Destroy;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Scope;

/**
* Loader for spaces binding information.
*
*/
@Scope("MODULE")
public class SpacesBindingLoader implements
StAXElementLoader<SpacesBinding> {

   /** Namespace used for the JavaSpaces binding */
   public static final QName BINDING_SPACES = new
QName("http://org.apache.tuscany/xmlns/spaces/0.9";, "binding.spaces");

   /** Stax loader registry that is injected in */
   protected StAXLoaderRegistry registry;

   /**
    * Injection method for the Stax loader registry.
    *
    * @param registry
    *            Stax loader registry.
    */
   @Autowire
   public void setRegistry(StAXLoaderRegistry registry) {
       this.registry = registry;
   }

   /**
    * Lifecycle method when the component is started.
    */
   @Init(eager = true)
   public void start() {
       registry.registerLoader(BINDING_SPACES, this);
   }

   /**
    * Lifecycle method when the component is stopped.
    */
   @Destroy
   public void stop() {
       registry.unregisterLoader(BINDING_SPACES, this);
   }

   /**
    * Creates the binding model object for JavaSpaces binding.
    */
   @SuppressWarnings("deprecation")
   public SpacesBinding load(XMLStreamReader reader, LoaderContext
loaderContext) {
       long timeout = Long.parseLong(reader.getAttributeValue(null,
"timeout"));
       return new SpacesBinding(timeout);
   }

}

This is the excerpt from the system.fragment file,

   <component
name="org.apache.tuscany.binding.spaces.loader.SpacesBindingLoader">
       <tuscany:implementation.system
class="org.apache.tuscany.binding.spaces.loader.SpacesBindingLoader"/>
   </component>

Ta
Meeraj

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy
Boynes
Sent: 01 June 2006 15:15
To: [email protected]
Subject: Re: "ConfigurationLoadException: Unrecognized element
.............." for a new binding type

On 6/1/06, Meeraj Kunnumpurath <[EMAIL PROTECTED]> wrote:
> You need to register the qualified name for the binding with the Stax
> loader registry.
>

Meeraj is spot on. We don't register loaders based on XML schema.
Instead each one needs to register with the LoaderRegistry for the
elements it can handle. There is some info on this on the wiki:
http://wiki.apache.org/ws/Tuscany/TuscanyJava/Extending/StAXLoading

One thing that's missing from the page is that for this to work the
class must be MODULE scoped (otherwise the @Init method won't be fired
early enough). I'll add an update for that later today.

--
Jeremy

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


This message has been checked for all email viruses by MessageLabs.




*****************************************************

   You can find us at www.voca.com

*****************************************************
This communication is confidential and intended for
the exclusive use of the addressee only. You should
not disclose its contents to any other person.
If you are not the intended recipient please notify
the sender named above immediately.

Registered in England, No 1023742,
Registered Office: Voca Limited
Drake House, Three Rivers Court,
Homestead Road, Rickmansworth,
Hertfordshire, WD3 1FX


This message has been checked for all email viruses by MessageLabs.

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





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

Reply via email to