Re: jDiameter XMLConfiguration

745 views
Skip to first unread message

Risto Mononen

unread,
Nov 24, 2012, 11:45:12 AM11/24/12
to mobicent...@googlegroups.com
Hello,
the tutorial below worked for me. Be careful to use correct client / server versions of the stack and xml helper libraries!


Class diameterClass = Class.forName("org.jdiameter.client.impl.StackImpl");


  BR, Risto


On Friday, November 23, 2012 8:34:57 PM UTC+2, Alexandre Brito wrote:
Hello,

I'm trying to play around with the jDiameter (https://code.google.com/p/jdiameter) and I've encounter some difficulties. This mailing list seems to be the right one for me to ask for some help. On the http://code.google.com/p/jdiameter I couldn't find the mailing or forum link..

I'm trying to build a java standalone diameter client application using the jdiameter v1.5.9.0. However, when running the application the jdiameter-client-config.xml is not accepted by the XMLConfiguration().

Here is a small block of the code:

            stack = new org.jdiameter.client.impl.StackImpl();          
            FileInputStream fileInputStream = new FileInputStream(new File(configFile));
            Configuration config = new XMLConfiguration(fileInputStream);

The application breaks when parsing the XML. I'm 100% sure that the XML is valid since I just copy-paste it from other examples.

The error is the following:

    org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'Configuration'.

It seems that the XMLConfiguration is trying to validate the XML Schema and fails.

The XML is something like:
    <?xml version="1.0"?>
    <Configuration xmlns="http://www.jdiameter.org/jdiameter-server">
       <LocalPeer>...</LocalPeer>
       <Parameters>...</Parameters>
       <Network>...</Network>
       <Extensions />
    </Configuration>


I'm no XML expert but is this because the "http://www.jdiameter.org/jdiameter-server" is a dead link?

I really hope someone could point me into the right direction?

Alex

krish

unread,
Nov 26, 2012, 6:26:58 AM11/26/12
to mobicent...@googlegroups.com

Dear Alex,

Are you able to execute the code.?

If not I had done until some part.But I am getting problematic exceptions.But my code is executable.

Will you please execute and try .
example.zip

Alexandre Mendonça

unread,
Nov 26, 2012, 7:14:05 AM11/26/12
to mobicent...@googlegroups.com
Hi Alexandre,

This is the right place to ask. We will update the project page with links to the mailing list, thanks for the heads up!

Regarding your problem, and as Risto mentioned, make sure to be using the correct client or server classes in your code. You should not be getting such problems if you do so, as, even if the namespace urls does not exist, it is resolved and validated locally to the existing XSDs.

Regards,

--
Alexandre Mendonça // JBoss R&D
http://ammendonca.blogspot.com/
Reply all
Reply to author
Forward
0 new messages