Loader persistence.xml
How does the JVM loader META-INF/persistence.xml?
any help greatly appreciated!
Originally posted by: beat.stradax.net
> 1) When I don't specify any properties:
> Persistence.createEntityManagerFactory("unitname");
>
> The OSGiPersistenceInitializationHelper#getClassLoader is called with
> "bundleresource://7/unitname" and doesn't find an entry for this,
> because the map contains only a key "unitname".
>
> 2) When I specify Thread.currentThread().getContextClassLoader() as a
> class loader property, this class loader doesn't find the resource
> "META-INF/persistence.xml" in
> PersistenceProvider#createEntityManagerFactory:95.
Well ok. With a class loader property
"this.getClass().getClassLoader()" it works.
Beat
Similar Messages
-
Unable to load persistence provider
hi,
i'm using spring context to reimplement some java methods in SOA suite.
I have a deplyed and runnable Spring MVC project, which use hibernate to connect between database and project POJO classes. i use this spring project's java methods which are used those POJO classes and DAO classes by which we access database.
Now i want to implement each methods in SOA suite . for that I define some spring contexts corresponding to each methods.
i added required jar files in project class path and added persistance.xml, orm.xml and spring project's MANIFEST.MF. after that for checking, i added main() method in ech spring context's impplementation classes to check if those methods are individual running or not. but yes, they are running in JDeveloper.
now i deploy this SOA project in weblogic enterprise manager, then test the service. its not work at all. in stacktrace i got following error/
WARNING: Unable to load persistence provider "oracle.toplink.essentials.PersistenceProvider" due to "oracle.classloade
util.AnnotatedClassNotFoundException:
Missing class: oracle.toplink.essentials.PersistenceProvider
Dependent class: org.apache.openjpa.persistence.PersistenceProductDerivation
Loader: sun.misc.Launcher$AppClassLoader@27770641
Code-Source: /C:/Fusion11g/Middleware11g_3/modules/org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
Configuration: /C:/Fusion11g/Middleware11g_3/modules/org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
This load was initiated at default.composite.RulesForLoanOrigination.soa_75e4602c-da8d-4a9d-b6b3-747aa3ee5372:1.0 usin
the Class.forName() method.
INFO: Found persistence provider "oracle.toplink.essentials.PersistenceProvider". OpenJPA will not be used.
WARNING: Unable to load persistence provider "oracle.toplink.essentials.PersistenceProvider" due to "oracle.classloade
util.AnnotatedClassNotFoundException:
Missing class: oracle.toplink.essentials.PersistenceProvider
Dependent class: org.apache.openjpa.persistence.PersistenceProductDerivation
Loader: sun.misc.Launcher$AppClassLoader@27770641
Code-Source: /C:/Fusion11g/Middleware11g_3/modules/org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
Configuration: /C:/Fusion11g/Middleware11g_3/modules/org.apache.openjpa_1.1.0.0_1-1-1-SNAPSHOT.jar
This load was initiated at default.composite.RulesForLoanOrigination.soa_75e4602c-da8d-4a9d-b6b3-747aa3ee5372:1.0 usin
the Class.forName() method.
INFO: Found persistence provider "oracle.toplink.essentials.PersistenceProvider". OpenJPA will not be used.
java.lang.ExceptionInInitializerError
at com.originator.dao.LoanDAO.findByPK(LoanDAO.java:23)
at com.origination.business.RiskCalculation.calculateRisk(RiskCalculation.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.sca.engine.WlsScaService.invokeTargetBeanMethod(WlsScaService.java:128)
at weblogic.sca.engine.WlsScaService.messageInvoker(WlsScaService.java:92)
at weblogic.sca.engine.WlsScaService.invoke(WlsScaService.java:39)
at weblogic.sca.engine.WlsScaEngine.messageInvoker(WlsScaEngine.java:114)
at weblogic.sca.engine.WlsScaEngine.invoke(WlsScaEngine.java:66)
at oracle.integration.platform.blocks.java.SpringServiceEngine.request(SpringServiceEngine.java:148)
at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:
9)
at oracle.integration.platform.blocks.mesh.MessageRouter.request(MessageRouter.java:179)
at oracle.integration.platform.blocks.mesh.MeshImpl.request(MeshImpl.java:155)
at sun.reflect.GeneratedMethodAccessor1874.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.jav
182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy272.request(Unknown Source)
at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.doMessageProcessing(WebServiceEntry
ndingComponent.java:1169)
at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.processIncomingMessage(WebServiceEn
yBindingComponent.java:768)
at oracle.integration.platform.blocks.soap.FabricProvider.processMessage(FabricProvider.java:113)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:1168)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:996)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:562)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:222)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:185)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:430)
at oracle.integration.platform.blocks.soap.FabricProviderServlet.doPost(FabricProviderServlet.java:477)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named OriginatorModel: T
following providers:
org.eclipse.persistence.jpa.PersistenceProvider
kodo.persistence.PersistenceProviderImpl
org.apache.openjpa.persistence.PersistenceProviderImpl
Returned null to createEntityManagerFactory.
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at com.originator.dao.EntityManagerHelper.<clinit>(EntityManagerHelper.java:21)
... 53 more
what i guess, after deploy, projects sca.jar do not takes those dependent jars (jpa.jar, toplink.jar,toplink-essential.jar etc) which i given in classpath.
but i don't khonw what is the actual problem.
please help mestick them into sca-inf/lib directory, and they are deployed and loaded.
hth clemens -
SAPUI5 Project - Missing persistence.xml
Hi,
I have created a simple SAPUI5 application having an Employee form. The values should be saved in the HANA DB. As there are multiple ways to save the data in HANA, I am exploring the JPA based approach.
I am following the Container-Managed Persistence Example and able to create the project. Instead of Dynamic Web project, I have created SAPUI5 project and also changed the project facets as mentioned in the tutorial.
Now the problem is that I am not able to deploy the project on SAP HCP. It is giving me following error -
2014 09 04 07:45:24#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##Unable to load Persistence Unit from EAR: /usr/sap/ljs/webapps/jadyn, module: file:/usr/sap/ljs/webapps/jadyn/WEB-INF/classes/. Exception: unexpected element (uri:"http://xmlns.jcp.org/xml/ns/persistence", local:"persistence"). Expected elements are <{http://java.sun.com/xml/ns/persistence}persistence>javax.xml.bind.UnmarshalException: unexpected element (uri:"http://xmlns.jcp.org/xml/ns/persistence", local:"persistence"). Expected elements are <{http://java.sun.com/xml/ns/persistence}persistence>
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:647)....
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##FAIL ... EmpBean:
Missing required persistence.xml for @PersistenceContext ref "em" to unit ""|
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##Invalid EjbModule(name=jadyn, path=/usr/sap/ljs/webapps/jadyn)|
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##FAIL ... jadyn:
Missing required persistence.xml for @PersistenceContext ref "em" to unit ""|
2014 09 04 07:45:27#+00#ERROR#unknown.jul.logger##anonymous#fs-watcher##p137653trial#jadyn#web##Invalid WebModule(name=jadyn, path=/usr/sap/ljs/webapps/jadyn)|
2014 09 04 07:45:27#+00#ERROR#org.eclipse.virgo.web.enterprise.openejb.deployer.VirgoDeployerEjb##anonymous#fs-watcher##p137653trial#jadyn#web##Error while deploying application with real path '/usr/sap/ljs/webapps/jadyn' and web context path '/jadyn'org.apache.openejb.config.ValidationFailedException: Module failed validation. AppModule(name=jadyn)
Anyone has any idea on what wrong I am doing. Please check the attached error log for more details. Thanks!
Regards
AbhiActually yes - please get familiar with The SCN Rules of Engagement! In particular, don't push if you haven't received an answer after 3 hours or so.
Now, I am not sure how a UI5 project is exported and what it packages but I would recommend using a Dynamic Web project which is intended for Java web development and supports JPA. You can also have your HTML and JS static resources in it.
Cheers,
--Vlado -
Deploy failure due to jta-data-source in persistence.xml
Hey All,
This is driving me insane. Every example, including the Sun tutorials (which don't work on my instance of Glassfish), list persistence.xml files like:
"<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
<persistence-unit name="persistence_sample">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<jta-data-source>jdbc/SamplesDB</jta-data-source>
<non-jta-data-source>jdbc/SamplesDB__nontx</non-jta-data-source>
</persistence-unit>
</persistence>"
I've tried every combination of <persistence...> tags, with namespace definitions, posted in examples on the internet, but my problem is, any time I deploy my ear with a "<jta-data-source>" tag specified, I receive the following failure from the App Server:
"Error loading deployment descriptors for module [pi-0] Line 26 Column 24 -- Deployment descriptor file META-INF/persistence.xml in archive [pi-ejb.jar]. cvc-complex-type.2.4.a: Invalid content was found starting with element 'jta-data-source'. One of '{"http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected.
at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:352)
at com.sun.enterprise.deployment.backend.AppDeployerBase.loadDescriptors(AppDeployerBase.java:327)
at com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:332)
at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:182)
at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'jta-data-source'. One of '{"http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected.
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:285)
at com.sun.enterprise.deployment.archivist.Archivist.readPersistenceDeploymentDescriptor(Archivist.java:1718)
at com.sun.enterprise.deployment.archivist.EjbArchivist.readPersistenceDeploymentDescriptors(EjbArchivist.java:239)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:301)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:200)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.readModulesDescriptors(ApplicationArchivist.java:308)
at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:316)
... 11 more"
Note that this only happens when I have a <jta-data-source> element in the persistence.xml file. When I comment out the jta-data-source, it deploys without problems (though it doesn't do much). Here's my persistence-unit code:
<persistence-unit name="prodcontext" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>OneOfMyClasses</class>
<jta-data-source>jdbc/SamplesDB</jta-data-source>
</persistence-unit>
Please help.
Thank you,
ToddOkay okay, my mistake (staring at this thing too long).
The solution is, I confess I overlooked it, the jta-data-source node in the xml has to follow the exact order specified in the xsd. I was putting it below the class nodes, which is a no-no. -
Cannot open persistence.xml nor orm.xml
I had to kill JDev process after I realized Data Control could not be created on a session EJB since application was not created with JSF,EJB technology. JDev kept trying to create Data Control. I left it trying over night and in the morning I killed process. I restarted JDev and tried to open files persistence.xml and orm.xml, but JDev just showed up message "Loading...Please wait." and it was stuck with that message. I could open all other files except these two XML files.
Is there a workaround?CG_AUDIO wrote:
Has anyone been able to open a pages file that has the cannot open .xml required error?
I opened a doc from pages'08 in pages'09 made some crucial changes saved as new name and cannot open it again now.
I tried opening in '08 and of course no luck.
I just finished 3 hours of writing and cannot do that again!!!
3 hours of writing without no intermediate save in different files is silly.
Attach the file to a mail
send them to my maibox.
I will try to revive the raw text.
Click my blue name to get my address.
IMPORTANT: search for the keystring _"backup, backup"_ in existing threads !
Yvan KOENIG (VALLAURIS, France.) jeudi 20 août 2009 20:09:19 -
Classnot found exception- persistence.xml
While Executing Unit test from Eclipse itself, Keep getting exception saying......Unable to load entity class, it's not on the classpath, check your persistence.xml
if anyone have some clue on that?
Entity classes are in some different project in eclipse & have added those Entities jars in My classpath.Nicky26 wrote:
While Executing Unit test from Eclipse itself, Keep getting exception saying......Unable to load entity class, it's not on the classpath, check your persistence.xml
if anyone have some clue on that?
Entity classes are in some different project in eclipse & have added those Entities jars in My classpath.Java does not agree with you and Java is the boss.
A thought: perhaps the wrong persistence.xml is loaded? In other words, do you have multiple persistence.xml files on the classpath? -
Error while loading an XML document using a structured application
Hi,
I try to load an XML document using a structured application defined in the default structapps.fm
My code is shown down, extracted from the FDK API code sample.
Problem, I always have the same message :
"Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "
Where "e:\xml\AdobeFrameMaker10\" is my install directory.
So I assume that frame try to find the structapps.fm file but does not find it.
What else can it be ?
Does anyone knowns how to achieve this simple task using extendScript ?
Thanks for any comments, Pierre
function openXMLFile(myLastFile) {
var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);
if (filename != null) {
/* Get default open properties. Return if it can’t be allocated. */
var params = GetOpenDefaultParams();
/* Set properties to open an XML document*/
/*Specify XML as file type to open*/
var i = GetPropIndex(params, Constants.FS_OpenAsType)
params[i].propVal.ival = Constants.FV_TYPE_XML;
/* Specify the XML application to be used when opening the document.*/
i = GetPropIndex(params, Constants.FS_StructuredOpenApplication)
params[i].propVal.sval = "myApp";
i = GetPropIndex(params, Constants.FS_FileIsOldVersion)
params[i].propVal.ival = Constants.FV_DoOK
i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc)
params[i].propVal.ival = Constants.FV_DoOK
i = GetPropIndex(params, Constants.FS_FileIsInUse)
params[i].propVal.ival = Constants.FV_DoCancel
i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure)
params[i].propVal.ival = Constants.FV_DoCancel
/*The structapps.fm file containing the specified application must have
already been read. The default structapps.fm file is read when FrameMaker is
opened so this shouldn't be a problem if the application to be used is
listed in the structapps.fm file.*/
var retParm = new PropVals()
var fileObj = Open(filename, params, retParm);
return fileObj
} else {
return null;Pierre,
Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
function openXMLFile ( ) {
var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
Good luck
Jang -
XML Parse error while loading an XML file
HI Folks,
I was trying to load and XML file into BODS.. The XML file is well-formed and the same when tested in other tools is getting loaded without any issues..
I have created a XML-File format with the corresponding XSD..
But here in BODS it is giving - Parse error
1) when i try to view the data of the source XML in my dataflow ..it is giving "XML Parser Failed".. and not able to show data..
2) When I run my job i get the same pares error - with details as under..
---> Error here is "Unable to recognize element 'TAB' " or some time is say " Element TAB should be qualified"
Please guide with this if you have any info..thanks
I'm pasting the XML source file format here for your reference:--
<?xml version="1.0" encoding="iso-8859-1" ?>
- <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
- <asx:values>
- <TAB>
- <items>
+ <CUSTOMER_RECORD>
<CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
<NAME_1>ABC</NAME_1>
<NAME_2>OFM/COMMERCIAL ACCOUNTS</NAME_2>
<STREET_1>31 CENTER DRIVE MCS2045</STREET_1>
<STREET_2 />
<CITY>BETHESDA</CITY>
<STATE_CODE>MD</STATE_CODE>
<POSTAL_CODE>20892-2045</POSTAL_CODE>
<COUNTRY_CODE>US</COUNTRY_CODE>
<ORDER_BLOCK />
<ERP_CREATE_DATE>20040610</ERP_CREATE_DATE>
<ERP_CREATED_BY>DGUPTA</ERP_CREATED_BY>
<ERP_MODIFY_DATE>20120201</ERP_MODIFY_DATE>
<ERP_MODIFIED_BY>LWOHLFEI</ERP_MODIFIED_BY>
<INDUSTRY_CODE>0103</INDUSTRY_CODE>
<ACCOUNT_GROUP_ID>0001</ACCOUNT_GROUP_ID>
<SALES_NOTE />
<ADDRESS_NOTE />
<CUSTOMER_CLASSIFICATION_CODE>02</CUSTOMER_CLASSIFICATION_CODE>
<GLN_NUMBER />
<PREVIOUS_ACCT_NO />
<ACCOUNT_TYPE />
<GAG />
<SDI_ID />
<HOSP_ID />
<HIN />
<DUNS />
<PO_BOX />
<POB_CITY />
<POB_ZIP />
<PHONE_NUMBER>77777</PHONE_NUMBER>
<EMAIL_DOMAIN />
<REQUESTER />
<ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
</CUSTOMER_RECORD>
- <SALES_ORG_DATA>
+ <item>
<CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
<SALES_ORG>0130</SALES_ORG>
<CUSTOMER_GROUP>03</CUSTOMER_GROUP>
<ORDER_BLOCK_CODE />
<ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
</item>
+ <item>
<CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
<SALES_ORG>0120</SALES_ORG>
<CUSTOMER_GROUP>11</CUSTOMER_GROUP>
<ORDER_BLOCK_CODE />
<ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
</item>
</SALES_ORG_DATA>
</items>
</TAB>
</asx:values>
</asx:abap>Pierre,
Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
function openXMLFile ( ) {
var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
Good luck
Jang -
Problem with Persistence.xml in JDev final after migration
Hi,
I am trying to migrate a current project from JDev 11gTp4 to the JDev production release. When deploying the EJB module I get the following problem though (Stack from DefaultServer.log)
weblogic.application.ModuleException: Exception preparing module: EJBModule(Nexus-NexusModel-ejb)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.DocumentBuilderFactory.setSchema(DocumentBuilderFactory.java:561)
at weblogic.xml.jaxp.RegistryDocumentBuilder.setupDocumentBuilderFactory(RegistryDocumentBuilder.java:393)
at weblogic.xml.jaxp.RegistryDocumentBuilder.getDefaultDocumentBuilderFactory(RegistryDocumentBuilder.java:359)
at weblogic.xml.jaxp.RegistryDocumentBuilder.getDocumentBuilder(RegistryDocumentBuilder.java:298)
at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:150)
at org.eclipse.persistence.platform.xml.jaxp.JAXPParser.parse(JAXPParser.java:163)
at org.eclipse.persistence.platform.xml.jaxp.JAXPParser.parse(JAXPParser.java:197)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:213)
at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:309)
at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsReader.read(XMLEntityMappingsReader.java:72)
at org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappingsReader.read(XMLEntityMappingsReader.java:112)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.loadStandardMappingFiles(MetadataProcessor.java:343)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.loadMappingFiles(MetadataProcessor.java:271)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:294)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:830)
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:189)
at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:330)
at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:245)
at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:63)
at weblogic.ejb.container.deployer.EJBModule.setupPersistenceUnitRegistry(EJBModule.java:209)
at weblogic.ejb.container.deployer.EJBModule$1.execute(EJBModule.java:310)
at weblogic.deployment.PersistenceUnitRegistryInitializer.setupPersistenceUnitRegistries(PersistenceUnitRegistryInitializer.java:62)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:376)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
My persistence.xml looks like
<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="Nexus-ejbPU">
<provider>
org.eclipse.persistence.jpa.PersistenceProvider
</provider>
<jta-data-source>
jdbc/NexusPoolDS
</jta-data-source>
<mapping-file>
META-INF/orm.xml
</mapping-file>
<properties>
<property name="eclipselink.target-server" value="WebLogic_10"/>
<property name="eclipselink.logging.file" value="Toplink.log"/>
<property name="eclipselink.logging.timestamp" value="true"/>
<property name="eclipselink.logging.exceptions" value="true"/>
<property name="eclipselink.logging.session" value="true"/>
</properties>
</persistence-unit>
</persistence>
orm.xml looks like this
<?xml version="1.0" encoding="windows-1252" ?>
<entity-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence/orm">
<persistence-unit-metadata>
<persistence-unit-defaults>
<schema>
XXX
</schema>
</persistence-unit-defaults>
</persistence-unit-metadata>
<package>
za.co.medscheme.model.persistence.xxx
</package>
<schema>
XXX
</schema>
</entity-mappings>
I have noticed that the persistence.xml file have changed quite drastically from the version we had in TP4 release during project upgrade, but can not explain the problem we are getting. I have also tried to just create a dummy project and create a persistence unit, and the file looks exactly the same afterwards. Any thoughts?
DrikusJust thought I would add a temporary solution to the problem for those of you sitting with the same issue.
In the root folder of your application you will find a src folder with a meta-inf folder and weblogic-application.xml inside.
Add the following before the closing weblogic-application tag...
<xml>
<parser-factory>
<saxparser-factory>
weblogic.xml.jaxp.WebLogicSAXParserFactory
</saxparser-factory>
<document-builder-factory>
weblogic.xml.jaxp.WebLogicDocumentBuilderFactory
</document-builder-factory>
<transformer-factory>
weblogic.xml.jaxp.WebLogicSAXTransformerFactory
</transformer-factory>
</parser-factory>
</xml>
If there wasnt an xml tag in the file, it seems that JDeveloper somehow adds one on the fly for you pointing to an oracle xml parser that does not contain the setSchema method required by weblogic on deployment.
Hope this helps anybody else that has this problem.
Regards
Drikus Britz -
Unable to load any XML from JAR - Please help!!
Hi All,
I am a student in the final days of my degree. I have been working on my final project for some time now, an applet which converts input text to a signal plot for line encoding schemes - AMI, NRZ etc. It is pretty much finished, but one small bug threatens to scuttle the entire project! I have been searching the web all day long for answers with little success, and as the castor forum still appears to be down I am posting here. Any suggestions or advice would be greatly appreciated.
The applet uses the castor databinding framework to load various XML data. I am using Eclipse 3.01 for development - when the program is run locally as an applet, everything works fine. When the program is bundled into a JAR file and nested into a clean folder with a html page and the jar file, when the command to read in XML is given, a NullPointerException occurs, indicating that castor was unable to access the XML files.
Below is one of the methods used to make castor load XML data:
public CodeSet loadCodeXML(String _codesetFilename)
String _mappingURI = "schema/codes/codesets-mapping.xml";
String _codesetURI = "schema/codes/" + _codesetFilename;
// Create a new Castor mapping object
Mapping mapping = new Mapping();
try // Attempt to load in the selected XML character set
mapping.loadMapping(_mappingURI); // Initialize 'mapping' with the map file
Unmarshaller unmar = new Unmarshaller(mapping); // Create a new XML Unmarshaller that uses 'mapping'
// The line below creates a new CharSet object called _codeset and populates it with the XML data
CodeSet _codeset = (CodeSet)unmar.unmarshal(new InputSource(new FileReader(_codesetURI)));
// The character set was successfully loaded, so pass new CharSet object back to caller and end
return _codeset;
} catch (Exception e) {
// If an error occurs while extracting the XML data, this block will execute:
JOptionPane.showMessageDialog(null, e); // Display a message dialog containing the exception error
return null; // Do not return a CharSet object to caller
}It would seem to me the problem lies within
String _mappingURI = "schema/codes/codesets-mapping.xml";
String _codesetURI = "schema/codes/" + _codesetFilename;I have read that files inside a JAR can be accessed in this way ( http://archive.codehaus.org/castor/user/msg00025.html ) but it won't appear to work.
If these are set to a full system path (outside any JAR) i.e. "/home/me/proj/schema/codes/codesets-mapping.xml", the application operates fine. Clearly this is no good however, as the XML data must reside within the JAR package. I have tried many permutations such as "jar://schema/..." , "/schema/..", "schema/..", with no success. I have read of using InputStream and getResource methods to access files within the jar but have had no success. I have checked the schema dir is being put into the JAR archive.
Could anyone suggest an appropriate way of loading XML files from within a JAR file in this context?
Thanks in advance for any replies.Hi, me again..
Re: mr_doghead - the filename of the file is passed from the calling function
public CodeSet loadCodeXML(String _codesetFilename)eg loadCodeXML(ami.xml) will return a CodeSet object containing the ami xml data
Anyway, I've manged to fix it up. The problem actually lies within castor, not my code at all. This is a known bug in castor that the dev's deemed 'not important' to fix, but I have to say the work around is EXTREMLY poorly documented online. Hence, this post is just to say how to fix it up if ne1 else is having trouble...
To load mappings, use:
mapping.loadMapping(getClass().getResource(_mappingURI).toString());where _mappingURI is a string such as "/xml/mapfile.xml"
However, the unmarshalling method takes in a file object, so getResourceAsStream must be used:
CharSet _charset = (CharSet)unmar.unmarshal(new InputSource(getClass().getResourceAsStream(_charsetURI)));Where CharSet is your custom object you are marshalling into, and _charsetURI is a relative path to your xml file.
Ugly as hell? Very.
Does it work? Perfectly.
take it ez guys, time for me to go hand this sht in! ;D -
Unable to load Oracle XML SQL utility
The following error appears for each java
class, when we attempt to load Oracle XML sql
utility into Oracle using the oraclexmlsqlload
script:
E.g.
Error while resolving class OracleXMLStore
ORA-00904: invalid column name
Does anyone know why we would receive this error?
Platform: Hp-UX 11.0
Oracle Version: 8.1.5.0
Background information:
The database was original created with the
compatible=8.0.5 set in the init.ora file, and
the creatation of java classes failed due to this,
so switched compatible to 8.1.0. Now after we
we adjusted the compatible setting and restarted
database, we started to receive the errors as
described above.
nullMurali,
Thank you, after I initialized Oracle's javavm
the errors disappeared.
The scripts were located under the javavm/install
directory.
Thanks again.
Murali K (guest) wrote:
: Hi Steven,
: Is the JavaVM loaded. i.e. are all the classes necessary for
: running Java in the server are loaded into the server? The
most
: common answer to your problem is that the javavm has not been
: initialized correctly or the database does not have all the
java
: library files necessary to load java programs.
: Please read chapter 4 in the Oracle8i java developers guide
: which talks about initializing a java-enabled database by
: running the initjvm script.
: If this still occurs then maybe it is a bug and we will have
to
: look at it.
: Thx
: Murali
: Steven Wegner (guest) wrote:
: : The following error appears for each java
: : class, when we attempt to load Oracle XML sql
: : utility into Oracle using the oraclexmlsqlload
: : script:
: : E.g.
: : Error while resolving class OracleXMLStore
: : ORA-00904: invalid column name
: : Does anyone know why we would receive this error?
: : Platform: Hp-UX 11.0
: : Oracle Version: 8.1.5.0
: : Background information:
: : The database was original created with the
: : compatible=8.0.5 set in the init.ora file, and
: : the creatation of java classes failed due to this,
: : so switched compatible to 8.1.0. Now after we
: : we adjusted the compatible setting and restarted
: : database, we started to receive the errors as
: : described above.
null -
Hi,
I am using TestStand 3.1. Someone before me has developped a lot of things in our application : specific steps, specific process model, ... . Now this person is not here anymore and I have a test report display problem.
After an execution, the execution window cannot display the test report and displays the following message :
"Unable to load the XML Report.
At line 285 End tag 'NOBR' does not match the start tag 'BR'."
Also with Internet Explorer, the test report cannot be displayed (and he locates the error at lign 287) .
Needless to say that I am a poor guy in XML code that's why I am asking you some help.
But, I opened the .xml with a text editor and that is the part of the code which causes the problem :
284 </Prop>
285 <BLOCKQUOTE>
286 <H5><NOBR>Begin Sequence: MainSequence
287 <BR>(X:\DATA_Utilisateur\Florian DENEVE\04_GENERIC\GenericTestMainSeq\GenericTestMainSeq.seq)<BR></BR></H5>
288 <table BORDERCOLOR=#000000 FRAME=BOX RULES=ALL WIDTH=70%><TBODY>
(please, be careful with the lines numbers, because i don't think that IE and TestStand have the same numbering)
I don't know if it's a problem of basic TestStand or if it's due to the new process model and modifications realized by my previous colleague.
Any ideas ?
Thanks in advance for your help.Ok, here they are.
There is a file called Addons.cfg.sources but I had to rename it to get it to attach
Attachments:
Addons.cfg.sources.txt 1 KB
Addons.cfg 53 KB
ResultProcessing.cfg 189 KB -
How can I load this XML with sql loader ?
Hi,
Im try to load a XML file into a XML table:
Create table TEST of XMLTYPE;
XML file is something like this:
<!DOCTYPE list SYSTEM "myfile.dtd">
<list>
<item id = 1> lot of tags an info here </item>
<item id = 9000> lot of tags an info here </item>
</list>
I dont know how to exactly create an appropriate control file to my XML. All examples I saw in documentation are similar to this one:
this is an example control file
LOAD DATA
INFILE *
INTO TABLE test
APPEND
XMLTYPE (xmldata)
FIELDS
I dont know how to complete this control file. Can anyone help me ?
thank you!
Message was edited by:
pollopoleaWell I found this working code
LOAD DATA
INFILE *
INTO TABLE test APPEND
xmltype(xmldata)
FIELDS
ext_fname filler char(30),
xmldata LOBFILE (ext_fname) TERMINATED BY EOF
BEGINDATA
mifile.xml
mifile2.xml
mifile3.xml
the main diference I found is that when i use:
Insert into test values (XMLType(bfilename('XMLDIR', 'swd_uC000025127.xml'),nls_charset_id('AL32UTF8')));
tag <!DOCTYPE list SYSTEM "myfile.dtd"> is expanded
(I explain at DTD insertion and errors with long DTD entities
Now using sql loader the tag is not modified.
I dont know if is there any difference, between each case. did I lost performance?
Message was edited by:
pollopolea -
How to load a XML file into a table using PL/SQL
Hi Guru,
I have a requirement, that i have to create a procedure or a package in PL/SQL to load XML file into a table.
How we can achive this.ODI_NewUser wrote:
Hi Guru,
I have a requirement, that i have to create a procedure or a package in PL/SQL to load XML file into a table.
How we can achive this.
Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
This is the xml file
karthick% cat emp_details.xml
<?xml version="1.0"?>
<ROWSET>
<ROW>
<EMPNO>7782</EMPNO>
<ENAME>CLARK</ENAME>
<JOB>MANAGER</JOB>
<MGR>7839</MGR>
<HIREDATE>09-JUN-1981</HIREDATE>
<SAL>2450</SAL>
<COM>0</COM>
<DEPTNO>10</DEPTNO>
</ROW>
<ROW>
<EMPNO>7839</EMPNO>
<ENAME>KING</ENAME>
<JOB>PRESIDENT</JOB>
<HIREDATE>17-NOV-1981</HIREDATE>
<SAL>5000</SAL>
<COM>0</COM>
<DEPTNO>10</DEPTNO>
</ROW>
</ROWSET>
You can write a query like this.
SQL> select *
2 from xmltable
3 (
4 '/ROWSET/ROW' passing xmltype
5 (
6 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
7 , nls_charset_id('AL32UTF8')
8 )
9 columns empno number path 'EMPNO'
10 , ename varchar2(6) path 'ENAME'
11 , job varchar2(9) path 'JOB'
12 , mgr number path 'MGR'
13 , hiredate varchar2(20)path 'HIREDATE'
14 , sal number path 'SAL'
15 , com number path 'COM'
16 , deptno number path 'DEPTNO'
17 );
EMPNO ENAME JOB MGR HIREDATE SAL COM DEPTNO
7782 CLARK MANAGER 7839 09-JUN-1981 2450 0 10
7839 KING PRESIDENT 17-NOV-1981 5000 0 10
SQL> -
An example about how to load a XML file
Hi,
I've been working on Oracle for many years but fot the first time I was asked to load a XML file into a table.
As an example, I've found this on the web, but it doesn't work.
Can someone tell me why? I hoped this example could help me.
the file acct.xml is this:
<?xml version="1.0"?>
<ACCOUNT_HEADER_ACK>
<HEADER>
<STATUS_CODE>100</STATUS_CODE>
<STATUS_REMARKS>check</STATUS_REMARKS>
</HEADER>
<DETAILS>
<DETAIL>
<SEGMENT_NUMBER>2</SEGMENT_NUMBER>
<REMARKS>rp polytechnic</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>3</SEGMENT_NUMBER>
<REMARKS>rp polytechnic administration</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>4</SEGMENT_NUMBER>
<REMARKS>rp polytechnic finance</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>5</SEGMENT_NUMBER>
<REMARKS>rp polytechnic logistics</REMARKS>
</DETAIL>
</DETAILS>
<HEADER>
<STATUS_CODE>500</STATUS_CODE>
<STATUS_REMARKS>process exception</STATUS_REMARKS>
</HEADER>
<DETAILS>
<DETAIL>
<SEGMENT_NUMBER>20</SEGMENT_NUMBER>
<REMARKS> base polytechnic</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>30</SEGMENT_NUMBER>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>40</SEGMENT_NUMBER>
<REMARKS> base polytechnic finance</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>50</SEGMENT_NUMBER>
<REMARKS> base polytechnic logistics</REMARKS>
</DETAIL>
</DETAILS>
</ACCOUNT_HEADER_ACK>
For the two tags HEADER and DETAILS I have the table:
create table xxrp_acct_details(
status_code number,
status_remarks varchar2(100),
segment_number number,
remarks varchar2(100)
before I've created a
create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
and after, can you give me a script for loading data by using XMLTABLE?
I've tried this but it doesn't work:
DECLARE
acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
BEGIN
insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
select x1.status_code,
x1.status_remarks,
x2.segment_number,
x2.remarks
from xmltable(
'/ACCOUNT_HEADER_ACK/HEADER'
passing acct_doc
columns header_no for ordinality,
status_code number path 'STATUS_CODE',
status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
'$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
passing acct_doc as "d",
x1.header_no as "hn"
columns segment_number number path 'SEGMENT_NUMBER',
remarks varchar2(100) path 'REMARKS'
) x2
END;
This should allow me to get something like this:
select * from xxrp_acct_details;
Statuscode status remarks segement remarks
100 check 2 rp polytechnic
100 check 3 rp polytechnic administration
100 check 4 rp polytechnic finance
100 check 5 rp polytechnic logistics
500 process exception 20 base polytechnic
500 process exception 30
500 process exception 40 base polytechnic finance
500 process exception 50 base polytechnic logistics
but I get:
Error report:
ORA-06550: line 19, column 11:
PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
ORA-06550: line 4, column 2:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
and if I try to change the script without using the column HEADER_NO o keep track of the header rank inside the document:
DECLARE
acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
BEGIN
insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
select x1.status_code,
x1.status_remarks,
x2.segment_number,
x2.remarks
from xmltable(
'/ACCOUNT_HEADER_ACK/HEADER'
passing acct_doc
columns status_code number path 'STATUS_CODE',
status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
'/ACCOUNT_HEADER_ACK/DETAILS'
passing acct_doc
columns segment_number number path 'SEGMENT_NUMBER',
remarks varchar2(100) path 'REMARKS'
) x2
END;
I get this message:
Error report:
ORA-19114: error during parsing the XQuery expression:
ORA-06550: line 1, column 13:
PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
ORA-06512: at line 4
19114. 00000 - "error during parsing the XQuery expression: %s"
*Cause: An error occurred during the parsing of the XQuery expression.
*Action: Check the detailed error message for the possible causes.
My oracle version is 10gR2 Express Edition
I do need a script for loading xml files into a table as soon as possible
Thanks in advance!Hello,
Your code is not readable (no code tags).
Anyway, you can use SQL*Loader to load a XML document into a table.
Here is the link of the documentation with both description and an example at the end of the
article.
http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb25loa.htm
Regards,
Dariyoosh
Maybe you are looking for
-
Creating new source system in bw
hi all i have got one problem with creating source system to bw from r/3,i have created RFC connection to bw and r/3 and i was trying to create source system manually and automated but it is not activating i'm getting fallowing error ...the fallowing
-
Why is the .jar file not created??
the error i get is : com.sun.kvem.midletsuite.InvalidJadException: Reason = 36 Error in opening jar file: list.jar and in the \j2mewtk\2.5.2\apps\list\bin there are only 2 files are : list.jad MANIFEST.MF. Why is that so? Edited by: angelusPiper on M
-
Hi All, I have developed prototype . When I am implementing this one , getting lot of doubts. 1. How to pass hidden variables using flex.(In jsp we pass it throuth hidden field, is there any mechanism similar to that one) 2. How to handle exceptions
-
hi gurus... what i m trying to 2 is to import a xml (query exported from production system) into test system, but this message is shown : bold Manually start the maintenance transaction for objects of type CWM Document bold has someone what the trans
-
ITunes Library file cannot be saved. An unknown error occurred. (-54)
I upgaded the OS on my phone today. When I tried to sync it later, this is the message I get: iTunes Library file cannot be saved. An unknown error occurred. (-54)