Convert Thrift to xsd generator producing php - xsd

I'm using the latest version of Thrift and trying to generate XSDs out of my Thrift schema.
When running thrift_0.10.0 --gen xsd mySchema.thrift it generates a php file !?
Why is there no xsd generated but instead a php file ?

As soon as you add at least one service to your IDL the XSD file will appear.

Related

Automated validation of XSD files, not XML instances

I am looking for a programmatic solution to this, not asking about a tool.
Given a directory of XSD files with imports to other XSD files in that directory,
I would like to verify all required imports are present and the XSDs are valid XML.
My current manual process:
Open XML Spy
Start a new project
Add XSD files
'Validate XML' on all XSD files.
This gives error messages if there are issues or missing files.
How files are imported:
<xs:import schemaLocation="Other.xsd" namespace="Foo"/>
I'm looking for an automated way to achieve this, preferably without the overhead of XML Spy, so that this can be integrated in an automated test.
This is not about validation XML instances based on those XSD files, only about validating the XSD files and their dependencies.
It depends on the platform your are on, on .NET (with XSD 1.0) you have good support for checking schemas with XmlSchemaSet by loading/compiling them and checking for any warnings or errors, details are at https://learn.microsoft.com/en-us/dotnet/standard/data/xml/xmlschemaset-for-schema-compilation#compiling-schemas.
I think with Java there are different APIs but somehow similar functionality available.

Apache POI Can't read content types part

In Java I have developed a simple program to read DOCX documents. Then I tryed to deploy jar libraries on Oracle database 11g (Java 1.6 version) with loadjava tool. All classes on datbase side are "Valid".
Whe I run the Java stored procedure on database I get exception:
org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:120)
at Docx.loadFromBlob(Docx:38)
Caused by: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !
at
org.apache.poi.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:107)
at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:56)
at
org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:167)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:662)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:269)
at
org.apache.poi.util.PackageHelper.open(PackageHelper.java:39)
Docx file is fine because I can open it with Java on my client. Also the Java version on my database is the same as on client side (NetBeans)
regards
Peter

Finding Older JasperReports XSD Schemas

I'm looking to find the 5.1.0 JasperReport XSD schema. I want to do some outside manipulation of the JRXML in a language other than Java.
The current publicly available XSD at http://jasperreports.sourceforge.net/xsd/jasperreport.xsd currently does not validate against my current 5.1.0 JRXML.
Anyone with guidance would be helpful. I also tried downloading the project files at sourceforge, and searching for any .XSD files, with none found.

Mule ldap connector not working xsd issue

In mule ldap connector examples shows xsd available in the http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd. But runtime it shows error, as this xsd not existsing. I browsed http://www.mulesoft.org/schema/mule/ there is no ldap directory after that. Any change in the ldap connector support? Am I wrong using mulestudio(3.5)? I used demo application in the https://github.com/mulesoft/ldap-connector
I'm getting an error like this
org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 122; schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd'
It seems like the Mule LDAP conncetor is having support only for Mule 3.3.2 and Mule 3.4 versions.
Try changing the schema declaration to the below one.
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ldap
http://www.mulesoft.org/schema/mule/ldap/current/mule-ldap.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
If not try changing you Mule version to 3.4.
Please refer to the link below for more details
Mule LDAP Connector
Hope this helps.
Do you have the LDAP connector in your build path? XSDs are always present in your JARs but not always on the web. If you're using MuleStudio, all you need to do is to drag an LDAP message processor from the palette into your flow. Doing so will cause MuleStudio to load the necessary libraries for the LDAP connector and modify your namespaces accordingly.
Judging by the error that you posted, it seems that you are missing a JAR file from your build path. If you are using a Maven project, you can take a look here to learn how to add the necessary dependencies to your pom.xml file. If you're working with a normal Mule project, dragging and dropping an LDAP message processor into your flow should be enough.
I should mention that you need to install the LDAP connector in Mule Studio before you can use it. You can do so through the Cloud Connectors update site that comes bundled with Mule Studio. You can access this update site by going on Help > Install New Software and choosing it from the drop down list.
If you're interested in learning more on how to use Mule, we host a number of interesting blog posts on http://blog.ricston.com.

Xerces error: org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl

I'm developing a web application using JSF 2.0, NetBeans 6.9.1, GlassFish Server 3.1, mojarra 2.0.3, and JasperReports 3.7.6. Included in my project library is the jar file "xerces-2.8.0.jar". This file was imported as part of the JasperReports jar file library. Whenever I try to deploy, run, or debug my project through NetBeans, I receive this error:
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.
After any change in my project my build fails, and I receive the above error, when I try to deploy, run, or debug it. I have to restart the server and run/debug a second time. I've searched the internet and cannot find a solution to this problem. I've looked at the jar file in question, and and DTDDVFactoryImpl does indeed extend from DTDDVFactory - I don't know why I'm receiving this error. While I can eventually get my project running, it would be much nicer if I wasn't receiving this error.
Can anyone please tell me how I can fix this? Do I need to remove this file from my project library? Do I need to update this file with a newer version/older version?
If you provide your own xerces.jar, you have to do that through the Endorsed Standards Override Mechanism (java -Djava.endorsed.dirs=/path/to/xerces.jar), you are not allowed to just add it on the classpath (and will sooner or later run into trouble if you do). Let me explain.
JAXP is the Java API for XML Processing. The creation of JAXP objects (like parsers, XSLT transfomers, DOM Documents) is done through the factory/factory-method pattern so you can plugin a new JAXP implementation (it has to be newer than the one provided in your JRE). Xerces provides (part of) a JAXP implementation and contains endorsed standards (an endorsed standard is a Java API defined through a standards process other than the Java Community Process, see the Endorsed Standards Override Mechanism). You'll run in all kinds of troubles if you don't use the ESOM.
I got this error when using Selenium with Glassfish. I got around it by copying XML jars (xerces-*, xalan-*, xml-apis*, serialize*) from selenium/libs/ to $AS_HOME/lib/endorsed (for Glassfish 2) or to $AS_HOME/glassfish/lib/endorsed for Glassfish 4.

Resources