You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/08/17 13:29:07 UTC

[GitHub] [beam] choinierec-orvis opened a new issue, #22755: [Bug]: XmlIO Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler

choinierec-orvis opened a new issue, #22755:
URL: https://github.com/apache/beam/issues/22755

   ### What happened?
   
   I'm trying to use the XmlIO SDK to parse XML and receiving the following error
   
   Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
   
   I'm using Java 17 as it says I can use Java 17 here on the quickstart page
   
   https://beam.apache.org/get-started/quickstart-java/
   
   > Download and install the [Java Development Kit (JDK)](https://www.oracle.com/technetwork/java/javase/downloads/index.html) version 8, 11, or 17. Verify that the [JAVA_HOME](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars001.html) environment variable is set and points to your JDK installation.
   
   I've added the Jakarta dependencies in order to use jaxb
   
   ```
           <dependency>
               <groupId>jakarta.xml.bind</groupId>
               <artifactId>jakarta.xml.bind-api</artifactId>
               <version>4.0.0</version>
           </dependency>
   
           <dependency>
               <groupId>com.sun.xml.bind</groupId>
               <artifactId>jaxb-impl</artifactId>
               <version>4.0.0</version>
               <scope>runtime</scope>
           </dependency>
   ```
   
   I believe the error is because the XmlIO SDK has not been updated to include the Jakarta dependancies since they have been moved to.
   
   Here is an example of my pipeline
   
   ```
   public class OrdersToBigQuery {
       public interface OrdersToBigQueryOptions extends PipelineOptions {
           @Description("File input path")
           @Default.String("order.xml")
           String getInputPath();
   
           void setInputPath(String value);
       }
   
       public static void main(String[] args) {
           PipelineOptionsFactory.register(OrdersToBigQueryOptions.class);
           OrdersToBigQueryOptions options =
               PipelineOptionsFactory.fromArgs(args).as(OrdersToBigQueryOptions.class);
   
           Pipeline p = Pipeline.create(options);
   
           p.apply("Read XML", XmlIO.<ComplexTypeOrder>read()
               .from(options.getInputPath())
               .withRootElement("orders")
               .withRecordElement("order")
               .withRecordClass(ComplexTypeOrder.class)
           );
       }
   }
   ```
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: io-java-xml


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] choinierec-orvis closed issue #22755: [Bug]: XmlIO Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler

Posted by GitBox <gi...@apache.org>.
choinierec-orvis closed issue #22755: [Bug]: XmlIO Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler
URL: https://github.com/apache/beam/issues/22755


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org