Saxon parser - use in OSB/ALSB

Hi All,
We are considering use saxon to replace Oracle/BEA's internal xslt parser to increase performance , i would like to know if anybody has experience with this.
As when i change to use saxon i also get following exception.
Throwable: javax.xml.stream.FactoryConfigurationError: Provider null could not be instantiated: java.lang.NullPoin
terException
Stack Trace:
javax.xml.stream.FactoryConfigurationError: Provider null could not be instantiated: java.lang.NullPointerExceptio
n
at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:75)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:136)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
at weblogic.descriptor.DescriptorReader.<init>(DescriptorReader.java:22)
at weblogic.management.provider.internal.ConfigReader.<init>(ConfigReader.java:71)
I have done following,
1.copied saxon libraries in $JAVA_HOME/jre/lib directory
2.created jaxp.properties in $JAVA_HOME/jre/lib
javax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
Rgds

Hi Anuj,
As per standard way to plugging in xslt parser i tried to add jaxp.properties.
Although there is another way in weblogic server uising xml registry to override the default parse and this way i succeeded in replacing weblogic default xslt parser.
However ALSB has its own implementation of XSLT parser which is part of sb_core.jar , this following class most likely com.bea.wli.sb.stages.transform.TransformFactoryImpl.
We would like to use our own parser as XSLT engine has a bug.
If a xpath function is used in XSLT resource(like concat, string-join) , then XSLT fails to execute , this bug is there from Weblogic 9.2 MP2 (ALSB 2.6.1) onwards [ in Weblogic 9.2 MP1 this  works properly].
So we wanted to change ALSB's default xslt parser to saxon, which is supposed to be best one available.
We do have case against this bug too ,and we hope we will get a patch .
Still we want to know if we can replace ALSB's default XSLT engine.
Rgds
Roy

Similar Messages

  • SOA suit 11g uses both ESB and OSB(ALSB)

    Hi, I am newbie to SOA suit 11g. Can somebody please explain the use of ESB and OSB(ALSB) both in SOA 11g.In SOA 11g ESB is being used only for mediation.Even OSB(ALSB) has same capability.Then why both needs to be used?Can't we use one of these?
    ~Pradeep

    hello Pradeep,
    there is quite some literature on this hot topic - actually it's one of the most frequently asked question from people who are using OSB and Soa Suite.
    if you google "OSB vs Mediator" you will find some useful links:
    http://www.scribd.com/doc/23622536/Oracle-SOA-Suite-11g-Mediator-vs-Oracle-Service-Bus-OSB
    SOA SUITE 11g - Mediator & OSB
    http://oracle-fusion-blogs.com/oracle-fusion-osb-mediator/
    and so on....

  • OSB (ALSB) Logging Redirect

    Hi all,
    how to redirect all the OSB(ALSB) related message logs ( Errors and transport exceptions included ) to a log4j custom file.
    Now, given this discussion:
    alsb logging
    The way to go is, apparently, to
    1. create filters at domain level by subsystem (or context_id or whatever else)
    2. create a startup class to catch all log messages and to filter in only those ones you are interested in using, in your filter class, filters like " startsWith("ALSB)) " (equivalent of domain filter "Subsystem LIKE ALSB% " )
    Now given all the following list of OSB (ALSB) related subsystems
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/messages/indexa.html
    *Is there a better approach then creating a filter class per each subsystem ?*
    Regards,
    Tony P.

    There doesn't seem to be 64bit version of OSB at all for Windows. [http://download.oracle.com/docs/cd/E13196_01/platform/suppconfigs/configs_al10gr3/osb10gr3/overview.html]

  • Setting Third-Party Saxon parser for parsing xml files

    Hi,
              I wish to parse certain xhtml files using saxon parser because that serves our needs. In order to that in tomcat, I used to use the following code -
              System.getProperties().setProperty("javax.xml.parsers.SAXParserFactory","com.icl.saxon.aelfred.SAXParserFactoryImpl");
              System.getProperties().setProperty("javax.xml.transform.TransformerFactory","com.icl.saxon.TransformerFactoryImpl");
              However this does not work in Weblogic 8.1 SP5. Which means, it actually ignores the settings and uses the default parser (which fails to parse the documents).
              I noticed that in weblogic I need to include these in the weblogic-application.xml located under the application/META-INF folder. I update the file with the following -
              <xml>
              <parser-factory>
              <saxparser-factory>com.icl.saxon.aelfred.SAXParserFactoryImpl</saxparser-factory>
              <transformer-factory>com.icl.saxon.TransformerFactoryImpl</transformer-factory>
              </parser-factory>
              </xml>
              Everything was fine and the documents were parsed but for every server start up, I got an error message -
              <Apr 4, 2006 10:34:43 AM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "action" failed to preload on startup in Web application: "HarvesterWeb".
              javax.servlet.UnavailableException: Parsing error processing resource path
              at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.initModuleConfig
              (AutoRegisterActionServlet.java:416)
              at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
              at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.init(AutoRegisterActionServlet.java:103)
              at javax.servlet.GenericServlet.init(GenericServlet.java:258)
              at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.init(AutoRegisterActionServlet.java:109)
              at com.bea.wlw.netui.pageflow.PageFlowActionServlet.init(PageFlowActionServlet.java:107)
              at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1094)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
              at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
              at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:970)
              at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:949)
              at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:888)
              at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3430)
              at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3375)
              at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3356)
              at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:6208)
              at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:864)
              at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2134)
              at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2175)
              at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2122)
              at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivation(SlaveDeployer.java:3099)
              at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.java:1768)
              at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:351)
              at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229)
              at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136)
              at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
              at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
              at weblogic.Server.main(Server.java:32)
              >
              And the server needs to be restarted after every couple of hits(particularly failures).
              Also, my other applications won't deploy throwing the same stack trace.
              At the end of all this, I get this message - Not sure if they are related but
              log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
              log4j:WARN Please initialize the log4j system properly.
              Any ideas or anyone run into these kind of situations? Moderators, can you please help?

    Try the following.
              1. Keep the 3rd party jars in your WLS classpath and not within your ear.
              2. Create an XML Registry through admin console.
              Services->XML.
              3. Enter appropriate values for the following
              Document Builder Factory:
              SAX Parser Factory:
              Transformer Factory:
              4. Restart WLS.
              Refer to this link. http://e-docs.bea.com/wls/docs81/ConsoleHelp/domain_xmlregistrytable.html
              cheers,
              Dips

  • Support of exslt in OSB/ALSB

    Hi,
    Does OSB/ALSb support extended xslt functions i.e exslt(http://exslt.org/functions)?
    When I tried to import/save an xslt having exslt functions, it gives an error
    An error occurred compiling the XSLT template: javax.xml.transform.TransformerException: weblogic.apache.xml.utils.WrappedRuntimeException: Could not find variable with the name of val.
    and the function is defined in xsl as :
    <func:function name="ctvf:convertToNumber">
    <xsl:param name="val"/>
    <xsl:variable name="strVal" select="string($val)"/>
    <xsl:choose>
    <xsl:when test="$strVal = 'NaN'">
    <func:result select="''"/>
    </xsl:when>
    <xsl:otherwise>
    <func:result select="$strVal"/>
    </xsl:otherwise>
    </xsl:choose>
    </func:function>
    where namespaces in the header are as:
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:func="http://exslt.org/functions"
    Thanks,
    Rajesh

    Hi all!
    Thanx for the answers! I have tried in the past the /text() I tried it again and didn´t worked, some body knows how can I post some screen shots so you can see that I´m using the /text() and maybe with the screen shot you can detect something, also I´m loging the $body in the default branch(cause it is not detecting the value between the tags it goes directly to the Defaul Branch) you will se some differences in the XML since I simplified the XML to make the example and tested this simplified XML it in the TEST Tool in the console and had the same results that with the original evendough I put the /text() at the end
    Here is the Body I loged in the default Branch:
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <imp:iniciarCambio xmlns:imp="http://bea.com/albpm/MMME/ImpactarCambiosClienteBILLING">
    <cambios xmlns:bea="http://bea.com/">
    <bea:ListaDeCambios>
    <!--1 or more repetitions:-->
    <bea:Cambio>
    <bea:campoNombre>Cambio1</bea:campoNombre>
    <bea:valorAnterior>antes</bea:valorAnterior>
    <bea:valorNuevo>despues</bea:valorNuevo>
    </bea:Cambio>
    </bea:ListaDeCambios>
    <bea:companiaId>32</bea:companiaId>
    <bea:companiaNombre>MMRedes</bea:companiaNombre>
    <bea:companiaTipo>Servicio</bea:companiaTipo>
    </cambios>
    </imp:iniciarCambio>
    </soapenv:Body>>
    as you can see it is Servicio and it should have gone to one of the branches instead of the default but it didn´t
    Can´t see what I´m doing wrong, but maybe some of you can.
    Thanx in advanced!
    Gerardo J

  • Is there a way to use a OSB variable into an XQuery Transformation?

    Hi,
    I´m trying to access to a variable that I declared in the OSB with an Assign, but I´m gettin and Error that the variabe is used but not declared, I also tried to use a OSB variable like $messageID and still have the same Error, has somebody used a previous declared variable into an XQuery Transformation?
    Thanx in Advanced!
    Kind Regards!

    Hi,
    In order to use a varible into a XQuery transformation you need to declare it as an input.
    When you are defining the source types (in the 'new XQuery Transformation' wizard) you should add the variable that you want to use.
    So if you assigned a variable called messageId and you want to use it in your message transformation using a XQuery resource you should add the following in the source types screen:
    - On the Available source targets click 'XML' and then select the xml message that you want to transform and click 'Add'
    - On the Available source targets click 'Simple' and then select 'string' and click 'Add'
    This should declare the xml that you want to transform and the variable that you want to use during the transformation.
    Hope it helps.
    Regards,
    Rodrigo

  • Parser used in Msg Mapping

    Hi all,
    We all know that DOM / SAX Parser will be used in Java Mapping.
    Then what is the parser used in Message Mapping.
    Thanks
    Krishna.

    Hi,
    Graphical Mapping is internally converted into a Java Code that uses SAX Parser.
    Regards
    Bhavesh

  • How to parse using DOM parser:

    <employee>
         <name>phaneendra</name>
         <age>21</age>
         <company>ABC</company>
         <Authorization>
              <ID>21<ID>
              <Role>Normal</Role>
         </Authorization>
    </employee>
    I am using DOM Parser.Using that parser how can i wil get the <Authorization> node value as
    <Authorization>
         <ID>21<ID>
         <Role>Normal</Role>
    </Authorization>
    thanks in advance

    Since you seem new to using DOM, I'll first give a word of advice.
    Get very familiar with the JavaDocs for things like Document, Element, Node and Attribute. There is much wisdom in those files, especially in the table near the top of the Node interface. Pay particular attention to the meaning of nodeValue for various types on content.
    Using DOM, you get a Document.
    From a Document, you can use the getDocumentElement to get the root element (in your case, the one with a name of "employee").
    From an Element, to get to a child Element with a specific name, use getElementsByTagName or getElementsByTagNameNS (if your elements are coded with NameSpaces).
    Then get the first entry in the resulting list and process it however you like.

  • OEPE 11.1.1.5.0 can be used for OSB 11.1.1.4.0 development?

    Hi all,
    Oracle® Fusion Middleware Upgrade Guide for Oracle Service Bus 11g Release 1 (11.1.1.4.0) says
    +"Oracle Service Bus 11g Release 1 (11.1.1.4.0) uses the Oracle Enterprise Pack for Eclipse 11.1.1.5.0 Integrated Development Environment (IDE)."+
    (see http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15032/upgrade.htm#CIAGDFBH)
    However, in the Create Server wizard in OEPE 11.1.1.5.0 which I have been using for OSB 11.1.1.3.0 development, Oracle WebLogic Server 11gR1 PatchSet 3 does not appear in the server type list.
    Is there any configuration required for using OEPE 11.1.1.5.0 for OSB 11.1.1.4.0 development?
    Or do I have to upgrade OEPE?
    Edited by: Kenji Imamura on 2011/03/31 19:22
    Edited by: Kenji Imamura on 2011/03/31 19:23

    I believe OSB 11.1.1.4.0 actually requires OEPE 11.1.1.6.1, so the docs are incorrect.
    - Konstantin

  • Returning CDATA using XQuery in ALSB

    I would like to know how to pass CDATA section using XQuery in ALSB. This is required as the client application wants certain data with XML tags as string. I used the following:
    <web:getFlightDetails xmlns:web="http://webservices.ods.mwcoe.united.com">
    <web:getFlightDetailsResponse>
    <XMLBODY>
    { fn:concat("<![CDATA[" ),  " ") }
    { $body/FML32/* }
    { fn:concat(("]]>"), " ") }
    </XMLBODY>
    </web:getFlightDetailsResponse>
    </web:getFlightDetails>
    But I get the following response:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
    <web:getFlightDetails xmlns:web="http://webservices.ods.mwcoe.united.com">
    <web:getFlightDetailsResponse>
    <XMLBODY>
    " & l t ; " ![CDATA[
    <STATDES>N/A</STATDES>
    <BAGFIN>-1</BAGFIN>
    <INBLK>2007-10-23 07:33:00</INBLK>
    <FLTDETORIG>SFO</FLTDETORIG>
    ]] "& g t ;"
    </XMLBODY>
    </web:getFlightDetailsResponse>
    </web:getFlightDetails>
    </soapenv:Body>
    </soapenv:Envelope>
    Basically the question is how do I pass < & > and not " & l t ;" and " & g t ;". Please space padding is done on purpose here.
    Thanks,
    Channu Kambalyal
    United Airlines.

    here we get it done using instead of
    { fn:concat("<![CDATA[" ), " ") }
    { $body/node() }
    { fn:concat(("]]>"), " ") }
    this:
    { fn:concat("<![CDATA[" ), $body/node(), "]]>") }
    getting a correct response
    ex:
    <XMLBODY>
    <![CDATA[
    <STATDES>N/A</STATDES>
    ]]>
    </XMLBODY>
    but, if there's any namespace on the variable node, we get all replace by <
    ex:
    <XMLBODY>
    " & l t ; " ![CDATA[
    & l t ; a:STATDES xmlns:a="http://localhost/a">N/A & l t ; /a:STATDES>
    ]] "& g t ;"
    </XMLBODY>
    do anybody have any idea why this happens?

  • OSB - ALSB / WLST / Security / add entry with WLST in  Access Control

    Hello,
    I try to reproduce with WLST script the input from the consol to declare user on Access Control proxy (security).
    sbconsol->$Proxy Service->Security->General Confiruration->Access Control->Transport Access Control->Add Conditions
    * First implementation without success with the com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean : accessControlSecurity1()
    * Second try with the service definition of the proxy service but cannot parse with Xpath accessControl Security2()
    any idee ???
    test case :
    prerequisit
    create an ALSB domain 10.3 (admin one with username='weblogic' password='weblogic' url='t3://localhost:7001') and create a proxy service on the default project
    conf/setEnv.cmd
    @CLS
    @echo ON
    @set BEA_HOME=D:\PRODUCT\MIDDLEWARE\SOA\OSB_10.3
    @set WL_HOME=%BEA_HOME%\wlserver_10.3
    @set OSB_HOME=%BEA_HOME%\osb_10.3
    @set SCRIPTING_HOME=E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security
    @set OSB_LIB=%OSB_HOME%/lib/sb-kernel-api.jar;%BEA_HOME%/modules/com.bea.alsb.statistics_1.0.1.0.jar;%OSB_HOME%/lib/sb-kernel-resources.jar;%OSB_HOME%/lib/sb-kernel-common.jar;%OSB_HOME%/lib/sb-kernel-impl.jar;%OSB_HOME%\lib\sb-security.jar;%OSB_HOME%/modules/com.bea.common.configfwk_1.3.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.1.0.jar;%OSB_HOME%/lib/modules/com.bea.alsb.resources.archive.jar;
    @set TOOL_LIB=%SCRIPTING_HOME%\lib\log4j-1.2.15.jar;%SCRIPTING_HOME%\lib\jsch-0.1.43.jar;%SCRIPTING_HOME%\lib\db2jcc.jar
    @set CLASSPATH=%OSB_LIB%;%TOOL_LIB%;%CLASSPATH%
    @set CLASSPATH=%SCRIPTING_HOME%\lib\db2jcc.jar;%TOOL_LIB%;%CLASSPATH%
    @set MODULE_LIB=%SCRIPTING_HOME%\lib
    @call %WL_HOME%\server\bin\setWLSEnv.cmd > nul 2<&1
    launch.cmd
    @CLS
    @echo OFF
    @SETLOCAL
    @call "conf\setEnv.cmd" > nul 2<&1
    set PWD=%~dp0
    %JAVA_HOME%\bin\java -Dmodule.lib=%MODULE_LIB% weblogic.WLST -skipWLSModuleScanning lib/security.py
    lib/security.py
    from com.bea.wli.monitoring import StatisticType
    from java.util import HashMap
    from java.util import HashSet
    from java.util import ArrayList
    from java.util import Collections
    from java.io import FileInputStream
    from java.io import FileOutputStream
    from java.lang import String
    from java.lang import Boolean
    from com.bea.wli.sb.util import EnvValueTypes
    from com.bea.wli.config.env import EnvValueQuery;
    from com.bea.wli.config import Ref
    from com.bea.wli.config.customization import Customization
    from com.bea.wli.config.customization import EnvValueCustomization
    from com.bea.wli.config.customization import FindAndReplaceCustomization
    from com.bea.wli.sb.management.configuration import SessionManagementMBean
    from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
    from com.bea.wli.sb.management.query import BusinessServiceQuery
    from com.bea.wli.sb.management.query import ProxyServiceQuery
    from com.bea.wli.sb.management.configuration import ServiceConfigurationMBean
    import os
    # before, create an ALSB domain 10.3 with a proxy service in the default project and add an Acces Control Policy in the consol
    # sbconsol->Project Explorer->default->${proxy service}->Security->Access Control->Create Session->Add Conditions->User->USR_1->Add
    # when we try to modify the Acces Control Policy of the proxy service with the ServiceSecurityConfigurationMBean
    def accessControlSecurity1( domain_name ):
              # connection
              print "\n\n\n***********************************************************************************************"
              connect( 'weblogic', 'weblogic', 't3://localhost:7001')
              domainRuntime()
              # create a session
              sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
              SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
              SessionMBean.createSession(sessionName)
              # get the ServiceSecurityConfigurationMBean
              serviceSecurityConfigurationMBean = findService(String("ServiceSecurityConfiguration.").concat(sessionName), "com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean")
              # get the XACMLAuthorizer
              working_directory=pwd()
              serverConfig()
              xacmlAuthorizer = cd('/SecurityConfiguration/%s/Realms/myrealm/Authorizers/XACMLAuthorizer' % domain_name )
              cd(working_directory)
              domainRuntime()
              # get service ref
              ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
              bsQuery = ProxyServiceQuery()
              bsQuery.setPath("default/*")
              refs = ConfigurationMBean.getRefs(bsQuery)
              for ref in refs:
                   print 'ref=%s'%ref               
                   # use the security Mbean to add : USER_A,USER_B,USER_C to the policy
                   policyHolder = serviceSecurityConfigurationMBean.newAccessControlPolicyHolderInstance(xacmlAuthorizer)
                   policyHolder.setPolicyExpression("Usr(USER_A,USER_B,USER_C)")     
                   policyScope = serviceSecurityConfigurationMBean.newDefaultMessagePolicyScope(ref)
                   serviceSecurityConfigurationMBean.setAccessControlPolicy(policyScope,policyHolder)
                   # print the service definition
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   print serviceDefinition
                   # we can see the security entry in the service definition has follow
                   # <xml-fragment xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
                   # <ser:coreEntry isProxy="true" isEnabled="true" isAutoPublish="false">
                   # <ser:description/>
                   # <ser:security>
                   # <con:access-control-policies xmlns:con="http://www.bea.com/wli/sb/services/security/config">
                   # <con:message-level-policies>
                   # <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config">
                   # <con:policy provider-id="XACMLAuthorizer">
                   # <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
                   # </con:policy>
                   # </con1:default-policy>
                   # </con:message-level-policies>
                   # </con:access-control-policies>
                   # </ser:security>
              # but when we commit
              SessionMBean.activateSession(sessionName, "description for session activation")
              # we got the following exception
              # Unexpected error: com.bea.wli.config.session.SessionConflictException
              # No stack trace available.
              # Problem invoking WLST - Traceback (innermost last):
              # File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 246, in ?
              # File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 105, in accessControlSecurity1
              # com.bea.wli.config.session.SessionConflictException: Conflicts for session SessionScript1363339726764
              # [Non-Critical] Concurrent Modification Conflicts
              # NONE
              # [Critical] Resources with validation errors
              # 1 - ProxyService test/PS_TEST_bis CannotCommit
              # + CannotCommit [OSB Security:386836]Unnecessary proxy wide message access control policy found for service "test/PS_TEST_bis". Hint: The service is neither an active security
              # intermediary nor has custom authentication enabled. ServiceDiagnosticLocation[SECURITY_TAB]:DiagnosticLocation:<con:message-level-policies xmlns:ser="http://www.bea.com/wli/sb/services" xml
              # ns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env" xmlns:con="http://www.bea.com/wli/sb/services/security/config">
              # <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/
              # config">
              # <con:policy provider-id="XACMLAuthorizer">
              # <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
              # </con:policy>
              # </con1:default-policy>
              # </con:message-level-policies>
              # [Info] Informational messages
              # NONE
              # at com.bea.wli.config.session.SessionManager.commitSessionUnlocked(SessionManager.java:358)
              # at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:339)
              # at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:297)
              # at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:306)
              disconnect()                              
    # when we try to modify the Acces Control Policy of the proxy service whith the service XML definition
    def accessControlSecurity2( domain_name ):
              # connection
              print "\n\n\n***********************************************************************************************"
              connect( 'weblogic', 'weblogic', 't3://localhost:7001')
              domainRuntime()
              # create a session
              sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
              SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
              SessionMBean.createSession(sessionName)
              # get service ref
              ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")               
              bsQuery = ProxyServiceQuery()
              bsQuery.setPath("default/*")
              refs = ConfigurationMBean.getRefs(bsQuery)
              for ref in refs:
                   print 'ref=%s'%ref
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   # parsing the proxy definition
                   nsSer = "declare namespace ser='http://www.bea.com/wli/sb/services'"
                   nsXsi = "declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'"
                   nsTran = "declare namespace tran='http://www.bea.com/wli/sb/transports'"
                   nsEnv = "declare namespace env='http://www.bea.com/wli/config/env'"
                   nsCon = "declare namespace con='http://www.bea.com/wli/sb/services/security/config'"
                   nsCon1 = "declare namespace con1='http://www.bea.com/wli/sb/services/security/config'"
                   # when we try to parse the following Xpath Expression, it' working but not sufficent to access the <con:policy-expression> element
                   confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy"
                   confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
                   print "WORKING{%s}" % confElem
                   # get the result
                   # <xml-fragment xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config" xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
                   # <con:policy provider-id="XACMLAuthorizer">
                   # <con:policy-expression>Usr(USER_1,USER_2,USER_3)</con:policy-expression>
                   # </con:policy>
                   # </xml-fragment>
                   # and when we try to acces the <con:policy> element whith the following Xpath expression we got an empty result
                   confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy/con:policy"
                   confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
                   print "DON'T WORKING{%s}" % confElem
                   # get empty result
                   # array([], org.apache.xmlbeans.XmlObject)
              # want to modify the value like this on the <con:policy-expression> but cannot reach it ...
              #confValue="Usr(USER_A,USER_B,USER_C)"
              #confElem.setStringValue(confValue)
              # commit                
              SessionMBean.activateSession(sessionName, "description for session activation")
              disconnect
    # print the service definition
    def printServiceDefinition( domain_name ):
              # connection
              connect( 'weblogic', 'weblogic', 't3://localhost:7001')
              domainRuntime()
              # create a session
              sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
              SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
              SessionMBean.createSession(sessionName)
              # get service ref
              ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")               
              bsQuery = ProxyServiceQuery()
              bsQuery.setPath("default/*")
              refs = ConfigurationMBean.getRefs(bsQuery)
              for ref in refs:
                   print 'ref=%s'%ref
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   print serviceDefinition
              # commit                
              SessionMBean.activateSession(sessionName, "description for session activation")
              disconnect
    #accessControlSecurity1('cluster_domain')
    accessControlSecurity2('cluster_domain')

    Hello,
    I try to reproduce with WLST script the input from the consol to declare user on Access Control proxy (security).
    sbconsol->$Proxy Service->Security->General Confiruration->Access Control->Transport Access Control->Add Conditions
    * First implementation without success with the com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean : accessControlSecurity1()
    * Second try with the service definition of the proxy service but cannot parse with Xpath accessControl Security2()
    any idee ???
    test case :
    prerequisit
    create an ALSB domain 10.3 (admin one with username='weblogic' password='weblogic' url='t3://localhost:7001') and create a proxy service on the default project
    conf/setEnv.cmd
    @CLS
    @echo ON
    @set BEA_HOME=D:\PRODUCT\MIDDLEWARE\SOA\OSB_10.3
    @set WL_HOME=%BEA_HOME%\wlserver_10.3
    @set OSB_HOME=%BEA_HOME%\osb_10.3
    @set SCRIPTING_HOME=E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security
    @set OSB_LIB=%OSB_HOME%/lib/sb-kernel-api.jar;%BEA_HOME%/modules/com.bea.alsb.statistics_1.0.1.0.jar;%OSB_HOME%/lib/sb-kernel-resources.jar;%OSB_HOME%/lib/sb-kernel-common.jar;%OSB_HOME%/lib/sb-kernel-impl.jar;%OSB_HOME%\lib\sb-security.jar;%OSB_HOME%/modules/com.bea.common.configfwk_1.3.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.0.0.jar;%BEA_HOME%/modules/com.bea.common.configfwk_1.2.1.0.jar;%OSB_HOME%/lib/modules/com.bea.alsb.resources.archive.jar;
    @set TOOL_LIB=%SCRIPTING_HOME%\lib\log4j-1.2.15.jar;%SCRIPTING_HOME%\lib\jsch-0.1.43.jar;%SCRIPTING_HOME%\lib\db2jcc.jar
    @set CLASSPATH=%OSB_LIB%;%TOOL_LIB%;%CLASSPATH%
    @set CLASSPATH=%SCRIPTING_HOME%\lib\db2jcc.jar;%TOOL_LIB%;%CLASSPATH%
    @set MODULE_LIB=%SCRIPTING_HOME%\lib
    @call %WL_HOME%\server\bin\setWLSEnv.cmd > nul 2<&1
    launch.cmd
    @CLS
    @echo OFF
    @SETLOCAL
    @call "conf\setEnv.cmd" > nul 2<&1
    set PWD=%~dp0
    %JAVA_HOME%\bin\java -Dmodule.lib=%MODULE_LIB% weblogic.WLST -skipWLSModuleScanning lib/security.py
    lib/security.py
    from com.bea.wli.monitoring import StatisticType
    from java.util import HashMap
    from java.util import HashSet
    from java.util import ArrayList
    from java.util import Collections
    from java.io import FileInputStream
    from java.io import FileOutputStream
    from java.lang import String
    from java.lang import Boolean
    from com.bea.wli.sb.util import EnvValueTypes
    from com.bea.wli.config.env import EnvValueQuery;
    from com.bea.wli.config import Ref
    from com.bea.wli.config.customization import Customization
    from com.bea.wli.config.customization import EnvValueCustomization
    from com.bea.wli.config.customization import FindAndReplaceCustomization
    from com.bea.wli.sb.management.configuration import SessionManagementMBean
    from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
    from com.bea.wli.sb.management.query import BusinessServiceQuery
    from com.bea.wli.sb.management.query import ProxyServiceQuery
    from com.bea.wli.sb.management.configuration import ServiceConfigurationMBean
    import os
    # before, create an ALSB domain 10.3 with a proxy service in the default project and add an Acces Control Policy in the consol
    # sbconsol->Project Explorer->default->${proxy service}->Security->Access Control->Create Session->Add Conditions->User->USR_1->Add
    # when we try to modify the Acces Control Policy of the proxy service with the ServiceSecurityConfigurationMBean
    def accessControlSecurity1( domain_name ):
              # connection
              print "\n\n\n***********************************************************************************************"
              connect( 'weblogic', 'weblogic', 't3://localhost:7001')
              domainRuntime()
              # create a session
              sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
              SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
              SessionMBean.createSession(sessionName)
              # get the ServiceSecurityConfigurationMBean
              serviceSecurityConfigurationMBean = findService(String("ServiceSecurityConfiguration.").concat(sessionName), "com.bea.wli.sb.security.management.configuration.ServiceSecurityConfigurationMBean")
              # get the XACMLAuthorizer
              working_directory=pwd()
              serverConfig()
              xacmlAuthorizer = cd('/SecurityConfiguration/%s/Realms/myrealm/Authorizers/XACMLAuthorizer' % domain_name )
              cd(working_directory)
              domainRuntime()
              # get service ref
              ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")
              bsQuery = ProxyServiceQuery()
              bsQuery.setPath("default/*")
              refs = ConfigurationMBean.getRefs(bsQuery)
              for ref in refs:
                   print 'ref=%s'%ref               
                   # use the security Mbean to add : USER_A,USER_B,USER_C to the policy
                   policyHolder = serviceSecurityConfigurationMBean.newAccessControlPolicyHolderInstance(xacmlAuthorizer)
                   policyHolder.setPolicyExpression("Usr(USER_A,USER_B,USER_C)")     
                   policyScope = serviceSecurityConfigurationMBean.newDefaultMessagePolicyScope(ref)
                   serviceSecurityConfigurationMBean.setAccessControlPolicy(policyScope,policyHolder)
                   # print the service definition
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   print serviceDefinition
                   # we can see the security entry in the service definition has follow
                   # <xml-fragment xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
                   # <ser:coreEntry isProxy="true" isEnabled="true" isAutoPublish="false">
                   # <ser:description/>
                   # <ser:security>
                   # <con:access-control-policies xmlns:con="http://www.bea.com/wli/sb/services/security/config">
                   # <con:message-level-policies>
                   # <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config">
                   # <con:policy provider-id="XACMLAuthorizer">
                   # <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
                   # </con:policy>
                   # </con1:default-policy>
                   # </con:message-level-policies>
                   # </con:access-control-policies>
                   # </ser:security>
              # but when we commit
              SessionMBean.activateSession(sessionName, "description for session activation")
              # we got the following exception
              # Unexpected error: com.bea.wli.config.session.SessionConflictException
              # No stack trace available.
              # Problem invoking WLST - Traceback (innermost last):
              # File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 246, in ?
              # File "E:\PROJETS\RECURANT\EDF\linky\WLST\WORKING\Security\lib\security.py", line 105, in accessControlSecurity1
              # com.bea.wli.config.session.SessionConflictException: Conflicts for session SessionScript1363339726764
              # [Non-Critical] Concurrent Modification Conflicts
              # NONE
              # [Critical] Resources with validation errors
              # 1 - ProxyService test/PS_TEST_bis CannotCommit
              # + CannotCommit [OSB Security:386836]Unnecessary proxy wide message access control policy found for service "test/PS_TEST_bis". Hint: The service is neither an active security
              # intermediary nor has custom authentication enabled. ServiceDiagnosticLocation[SECURITY_TAB]:DiagnosticLocation:<con:message-level-policies xmlns:ser="http://www.bea.com/wli/sb/services" xml
              # ns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env" xmlns:con="http://www.bea.com/wli/sb/services/security/config">
              # <con1:default-policy xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/
              # config">
              # <con:policy provider-id="XACMLAuthorizer">
              # <con:policy-expression>Usr(USER_A,USER_B,USER_C)</con:policy-expression>
              # </con:policy>
              # </con1:default-policy>
              # </con:message-level-policies>
              # [Info] Informational messages
              # NONE
              # at com.bea.wli.config.session.SessionManager.commitSessionUnlocked(SessionManager.java:358)
              # at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:339)
              # at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:297)
              # at com.bea.wli.config.session.SessionManager.commitSession(SessionManager.java:306)
              disconnect()                              
    # when we try to modify the Acces Control Policy of the proxy service whith the service XML definition
    def accessControlSecurity2( domain_name ):
              # connection
              print "\n\n\n***********************************************************************************************"
              connect( 'weblogic', 'weblogic', 't3://localhost:7001')
              domainRuntime()
              # create a session
              sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
              SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
              SessionMBean.createSession(sessionName)
              # get service ref
              ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")               
              bsQuery = ProxyServiceQuery()
              bsQuery.setPath("default/*")
              refs = ConfigurationMBean.getRefs(bsQuery)
              for ref in refs:
                   print 'ref=%s'%ref
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   # parsing the proxy definition
                   nsSer = "declare namespace ser='http://www.bea.com/wli/sb/services'"
                   nsXsi = "declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'"
                   nsTran = "declare namespace tran='http://www.bea.com/wli/sb/transports'"
                   nsEnv = "declare namespace env='http://www.bea.com/wli/config/env'"
                   nsCon = "declare namespace con='http://www.bea.com/wli/sb/services/security/config'"
                   nsCon1 = "declare namespace con1='http://www.bea.com/wli/sb/services/security/config'"
                   # when we try to parse the following Xpath Expression, it' working but not sufficent to access the <con:policy-expression> element
                   confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy"
                   confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
                   print "WORKING{%s}" % confElem
                   # get the result
                   # <xml-fragment xsi:type="con:ProviderPolicyContainerType" xmlns:con="http://www.bea.com/wli/sb/security/accesscontrol/config" xmlns:con1="http://www.bea.com/wli/sb/services/security/config" xmlns:ser="http://www.bea.com/wli/sb/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:env="http://www.bea.com/wli/config/env">
                   # <con:policy provider-id="XACMLAuthorizer">
                   # <con:policy-expression>Usr(USER_1,USER_2,USER_3)</con:policy-expression>
                   # </con:policy>
                   # </xml-fragment>
                   # and when we try to acces the <con:policy> element whith the following Xpath expression we got an empty result
                   confPath = "ser:coreEntry/ser:security/con:access-control-policies/con1:transport-level-policy/con:policy"
                   confElem = serviceDefinition.selectPath(nsSer + nsXsi + nsTran + nsEnv + nsCon + nsCon1 + confPath )
                   print "DON'T WORKING{%s}" % confElem
                   # get empty result
                   # array([], org.apache.xmlbeans.XmlObject)
              # want to modify the value like this on the <con:policy-expression> but cannot reach it ...
              #confValue="Usr(USER_A,USER_B,USER_C)"
              #confElem.setStringValue(confValue)
              # commit                
              SessionMBean.activateSession(sessionName, "description for session activation")
              disconnect
    # print the service definition
    def printServiceDefinition( domain_name ):
              # connection
              connect( 'weblogic', 'weblogic', 't3://localhost:7001')
              domainRuntime()
              # create a session
              sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())
              SessionMBean = findService( SessionManagementMBean.NAME ,SessionManagementMBean.TYPE)
              SessionMBean.createSession(sessionName)
              # get service ref
              ConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "com.bea.wli.sb.management.configuration.ALSBConfigurationMBean")               
              bsQuery = ProxyServiceQuery()
              bsQuery.setPath("default/*")
              refs = ConfigurationMBean.getRefs(bsQuery)
              for ref in refs:
                   print 'ref=%s'%ref
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   servConfMBean = findService( "%s.%s" % (ServiceConfigurationMBean.NAME, sessionName), ServiceConfigurationMBean.TYPE)
                   serviceDefinition = servConfMBean.getServiceDefinition(ref)
                   print serviceDefinition
              # commit                
              SessionMBean.activateSession(sessionName, "description for session activation")
              disconnect
    #accessControlSecurity1('cluster_domain')
    accessControlSecurity2('cluster_domain')

  • OSB (ALSB) to implement a Resequencer? (EIP Pattern)

    Hello *,
    has somebody ever tried to implement using OSB (BEA ALSB) the Resequencer EIP Pattern (Hohpe, Woolf)?
    http://www.enterpriseintegrationpatterns.com/Resequencer.html
    Generally I wonder how the OSB product concept maps to the EIP Patterns. Are there some guidelines for scenarios like Splitter/Aggregator , Enricher/Filter, etc.?
    my customer want's to implement at least the Resequence and Splitter. Any tips are very welcome here!!
    grtx,
    \thomas

    Hi Thomas,
    Depending on your exact requirement for your Resequencer you may be able to use the underlying WebLogic JMS Unit of Order to get this. Read more here:
    http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/jms/uoo.html
    With regards the other patterns, OSB supports all the ones you mention:
    Splitter/Aggregator - use the split/join functionality described here:
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/splitjoin.html
    Enricher - this can be achieved in a number of ways depending on where you are getting your enrichment data from. Service callouts allow you to invoke a service from within the proxy message flow, Java callouts allows you to implement Java code, and there is an XQuery function to allow you to read content from a database (note in the next release of OSB we will have support for the Oracle database adapter and so will have richer functionality here)
    Filter - again this depends on the exact requirement but there are a number of options here including routing tables, if/then capability, operational branching, etc.
    Hope that is useful.
    Chris

  • Xml parsing using dom4j

    I have some XML in String format, and I want to use the DocumentHelper.parseText() method on that string to parse it to Document format.
    I use it and it doesn't say anything about an error, however when I try to get "getelementroot()" and "getattributevalue" it gives me null.
    The XML looks like this:
    <Response status="1">
    <ERROR code="1">Offer is not available. </ERROR>
    <OFFER_ID>fPSC00010_PKG</OFFER_ID>
    </Response>
    I want to get the value of "status", i.e 1 in this case. So I do something like this:
    Element e = doc.getRootElement();
    String s = e.attributeValue("Status");
    Have I misunderstood something or what?

    Well I am not 100% sure why your code is causing a problem. I used dom4j 1 year ago.
    But I can give you my code snippet, the difference there to your snippet is that I first retrieved an Iterator over the Root element. And as I think the root element in your case is not the "Response" element it is more like a pointer to the start of the document. I am sorry for my vague explanation,it's too long age.
    But I am sure that you can use my example for your need effectively.
    public XMLMetaReader( String fileName )
            Document document = null;
            try
                SAXReader reader = new SAXReader( true );
                document = reader.read( fileName );
                root = document.getRootElement();
                createDBTree();
            catch ( DocumentException e )
                e.printStackTrace();
        public Map getSourceTables()
            return sourceTables;
        /** Return all tables which are set in the currently connected Database. */
        private void createDBTree() throws DocumentException
            for ( Iterator iterator0 = root.elementIterator( "database" ); iterator0.hasNext(); )
                Element databaseNode = ( Element ) iterator0.next();
                database = databaseNode.attributeValue( "ID" );
                // iterate through child elements of root with element name "table"
                for ( Iterator iterator = databaseNode.elementIterator( "table" ); iterator.hasNext(); )
                    Element tableNode = ( Element ) iterator.next();
                    Table table = new Table( tableNode.attributeValue( "ID" ) );
                    sourceTables.put( tableNode.attributeValue( "ID" ), table );
                    // iterate through child elements of root with element name "field"
                    for ( Iterator iterator2 = tableNode.elementIterator( "field" ); iterator2.hasNext(); )
                        Element fieldNode = ( Element ) iterator2.next();
                        Field field = new Field( fieldNode.attributeValue( "ID" ) );
                        field.setOriginalDomain( fieldNode.attributeValue( "datatype" ) );
                        if ( fieldNode.attributeValue( "default" ) != null )
                            String fieldValue = fieldNode.attributeValue( "default" );
                            if ( ( fieldValue ).equalsIgnoreCase( "NULL" ) )
                                field.setIsOriginalNullable( true );
                            else if ( ( fieldValue ).equalsIgnoreCase( "NOT NULL" ) )
                                field.setIsOriginalNullable( false );
                            else
                                field.setOriginalDefault( fieldValue );
                        table.addField( field );
                    for ( Iterator iterator2 = tableNode.elementIterator( "primarykey" ); iterator2.hasNext(); )
                        Element primaryNode = ( Element ) iterator2.next();
                        for ( Iterator iterator3 = primaryNode.elementIterator( "key" ); iterator3.hasNext(); )
                            Element keyNode = ( Element ) iterator3.next();
                            table.addPrimaryKey( keyNode.attributeValue( "field" ) );
                            Field primaryField = table.getField( keyNode.attributeValue( "field" ) );
                            primaryField.setIsOriginalPrimary( true );
                    for ( Iterator iterator2 = tableNode.elementIterator( "foreignkey" ); iterator2.hasNext(); )
                        Element foreignNode = ( Element ) iterator2.next();
                        ForeignKey foreignKey = new ForeignKey();
                        for ( Iterator iterator3 = foreignNode.elementIterator( "key" ); iterator3.hasNext(); )
                            Element keyNode = ( Element ) iterator3.next();
                            foreignKey.setOnField( keyNode.attributeValue( "field" ) );
                            System.out.println( keyNode.attributeValue( "field" ) );
                            foreignKey.setReferencedTable( keyNode.attributeValue( "references" ) );
                            System.out.println( keyNode.attributeValue( "references" ) );
                        for ( Iterator iterator3 = foreignNode.elementIterator( "onupdate" ); iterator3.hasNext(); )
                            Element onUpdateNode = ( Element ) iterator3.next();
                            foreignKey.setOnUpdate( onUpdateNode.attributeValue( "action" ) );
                        for ( Iterator iterator3 = foreignNode.elementIterator( "ondelete" ); iterator3.hasNext(); )
                            Element onDeleteNode = ( Element ) iterator3.next();
                            foreignKey.setOnDelete( onDeleteNode.attributeValue( "action" ) );
                        table.addForeignKey( foreignKey );
                    for ( Iterator iterator2 = tableNode.elementIterator( "index" ); iterator2.hasNext(); )
                        Element indexNode = ( Element ) iterator2.next();
                        Index index = new Index( indexNode.attributeValue( "name" ) );
                        index.setIsUNIQUE( ( indexNode.attributeValue( "unique" ) ).equalsIgnoreCase( "true" )  );
                        index.setIsDESC( ( indexNode.attributeValue( "ASC" ) ).equalsIgnoreCase( "true" )  );
                        /* index.setTable( tableNode.attributeValue( "ID" ) ); */
                        for ( Iterator iterator3 = indexNode.elementIterator( "indexfield" ); iterator3.hasNext(); )
                            Element indexFieldElement = ( Element )iterator3.next();
                            int position = Integer.parseInt( indexFieldElement.attributeValue( "position" ) );
                            index.addField( indexFieldElement.attributeValue( "field" ), ( short ) position );
                        table.addIndex( index );
                    for ( Iterator iterator2 = tableNode.elementIterator( "uniqueclause" ); iterator2.hasNext(); )
                        Element uniqueNode = ( Element ) iterator2.next();
                        UniqueConstraint uniqueConstraint = new UniqueConstraint();
                        for ( Iterator iterator3 = tableNode.elementIterator( "uniquefield" ); iterator3.hasNext(); )
                            Element uniqueFieldNode = ( Element ) iterator3.next();
                            uniqueConstraint.addField( uniqueFieldNode.attributeValue( "field" ) );
    }Hope it helps.
    Best regards
    Tarik

  • XML - 0112 Error on parsing using SAX and xml file in InputSource object.

    I need to parse a XML string and extract some information. I have to use SAX parser. I'm converting hte string to InputSource and then trying to parese.
    i'm getting XML-0112 error, my guess is that it is not able to locate DTD file but i tried hardcoding the whole path in DOCTYPE tag.
    i tried doing setSystemId also but no luck.
    null

    Can you post a simple test case to look at?

  • Xml parsing using java DefaultHandler of org.xml.sax.helpers.DefaultHandler

    i am using
    org.xml.sax.helpers.DefaultHandler api for parsing xml file ,while parsing i am getting exception sometimes ,
    i am using code below to parse the element and then store it to vectore
    parser truncate the charaacters sometimes like parsing string
    " NJ-HealthCare " i am getting only " NJ-HealthCare " and remaing characters are added in new element
    public void characters(char ch[], int start, int length) {
    try{
    ElementVal="";
    System.out.println(" start "+start+" ength :: "+length);
    String ElementVal = new String(ch,start,length);
    v.addElement( ElementVal );
    }catch(Exception ex){
    System.out.println("Exception in vector::"+ex);
    System.out.println(""+ex.getMessage());
    ex.printStackTrace();
    }

    This is an FAQ in the XML forum. The characters() method is not required to give you an entire text node all at once. The parser is free to split up the text node and call characters() several times if it likes. Your program will have to account for that possibility.

Maybe you are looking for

  • Update problems with Premiere Pro and AAM (Adobe Applications Manager)

    I am using Premiere Pro CS6 via a Creative Cloud subscription and am having a problem. AAM (Adobe Application Manager) says that Premiere Pro needs updating to 6.0.1 but if I run Premiere Pro and check it's version, it says it already is 6.0.1 - so h

  • 10.9.5 Maverick won't recognize projector

    I have a 2013 MBP, running 10.9.5 to a Epson PowerLite Home Cinema 8350 projector.  The projector give me "No Signal"  I am running a cord from the Thunderbolt port to the HDMI port no the projector.  I have tried: both thunderbolt ports and both HDM

  • Can I check the balance of a giftcard without redeeming it?

    I have a giftcard i want to give as a gift but i would like to verify its balance before I give it. I might have used it already...the code is exposed. Is there anyway to check the balance like I can for every other store, like bestbuy or barnes&nobl

  • Photo stream pictures

    I was sent an email invite for a photo stream of pictures and have the invite to open it in iCloud, but when I click on the invite, nothing happens.  Please help, these are important.

  • J2EE Tutorial:  SunSpecific Settings dialog box Frozen

    I was trying to package the OrderApp example in the tutorial (Chap 27) and after defining the relationships between the different entity beans in DataRegistryJAR, I tried to set the JDNI Name in Sun Specific Settings dialog box. After that the dialog