In the mean time i managed to get a step further. BY adding the following
piece of code:

Properties p = new Properties();
p.put("rfh", "http://www.rfh.nl/XMLHeader/10";);
marshaller.setNameSpaceMappings(p);

just before marshalling to XML, i get the following output:

<rfh:Header>

So, the prefix is now added, but the xmlns attribute is still missing.
That's it so far.




harmengosen wrote:
> 
> Hi Werner,
> 
> I'm sorry but i think i didn't express myself very well. What i mean is
> that in my development environment both descriptor and .cdr files are on
> the classpath, but this is not the case when í'm deploying because the
> .cdr files are missing from the generated jar. So when i'm running the app
> locally on my development machine, all resources are avalable, but it
> still doesn't work.
> 
> 
> Werner Guttmann wrote:
>> 
>> Yes, I think you are wrong. The .cdr files need to be on the classpath,
>> otherwise Castor will not be able to find descriptor classes. In other
>> words, please make sure that both the descriptor classes as well as the
>> .cdr files are available.
>> 
>> Werner
>> 
>> harmengosen wrote:
>>> Hi Werner,
>>> 
>>> thanks for you quick reply!
>>> I have inspected my .jar file and the descriptor files are there but the
>>> .cdr files are not. However, this seems to be a problem only when i
>>> deploy
>>> the application to an application server. However, my development
>>> environment (RSA 7.0) should have access to the missing .cdr files and
>>> when
>>> i'm running the application there it should not cause any problems.
>>> 
>>> So, there definitely is a problem because the .cdr files are not in the
>>> .jar, but when working with my local development environment there
>>> should be
>>> no problem.
>>> 
>>> Or  am i mistaken?
>>> 
>>> Regards,
>>> Harry
>>> 
>>> 
>>> Werner Guttmann wrote:
>>>> Hi,
>>>>
>>>> did you compile the descriptor classes and package them with your
>>>> application JAR (including the .cdr files) ? If that's not the case,
>>>> Castor (upon marshalling) will use introspection, and that's what it
>>>> looks like.
>>>>
>>>> Regards
>>>> Werner
>>>>
>>>> harmengosen wrote:
>>>>> Hi,
>>>>>
>>>>> i'm relatively new to Castor so please forgive me if the question
>>>>> seems
>>>>> trivial.
>>>>>
>>>>> I have generated classes using Castor codegen v.1.2, from XSD's. When
>>>>> i
>>>>> create an object model using these classes and then marshall it to
>>>>> XML,
>>>>> the
>>>>> namespaces are omitted, but that is not what i want.
>>>>> This is what i get:
>>>>>
>>>>> &lt;Header&gt;
>>>>>
>>>>> and this is what i want:
>>>>>
>>>>> &lt;rfh:Header xmlns:rfh="..." &gt;
>>>>>
>>>>> I have not found a clue as to why Castor doesn't generate this
>>>>> namespace.
>>>>> The namespace was present in the XSD that i used to generate the
>>>>> classes
>>>>> and
>>>>> descriptorfiles from.
>>>>>
>>>>> Am i omitting/forgetting something?
>>>>>
>>>>> Thanks a lot for your help!
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>     http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>>
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-generating-namespaces-during-Mashall-tp21849114p21868940.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to