Does apache poi 5.2.3 supports xmlbeans 5.1.1? - apache-poi

I am using poi and poi-ooxml of version 5.2.3 in my project and I am getting this error
-java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.put(Ljava/lang/Object;)V.
The dependency downloaded xmlbeans 5.1.1, When I checked xmlbeans 5.1.1 the put method is not present. So how can I use poi 5.2.3?
my pom.xml:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>

Related

Problems with migration apache-poi from 3.17 to 4.1.1

After updating Apache POI from 3.17 to 4.1.1 i'm getting this error message:
org.apache.commons.jxpath.JXPathNotFoundException: No value for xpath:
/xxxx/value at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:383)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:313)
Here is my pom:
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.3</version>
</dependency>
My setup:
JDK 8
WildFly 10
JXPath - the last version is 1.3
https://mvnrepository.com/artifact/commons-jxpath/commons-jxpath

Updating cucumber-java from 1.2.4 of info.cukes's to 4.2.2 of cucumber.io throwing import Given(Or When/Then) cannot be resolved error

As part of update, I had to migrate from info.cukes's cucumber-java with version 1.2.4 to io.cucumber's cucumber-java with version 4.2.2, but the code which ran successfully with older version of cucumber started throwing error, which says The import cucumber.api.java.en.Given(Or When/Then) cannot be resolved
Below is the cucumber class from where execution is starting
{
#RunWith(Cucumber.class)
#CucumberOptions(features = "classpath:features/functional/",
glue = {"com.jacksparrow.automation.steps_definitions.functional" },
tags = { "#guest_search_in_progress" },
plugin = { "pretty","json:target/cucumber-json/cucumber.json",
"junit:target/cucumber-reports/Cucumber.xml", "html:target/cucumber-
reports"},
strict = false,
dryRun = false,
monochrome = true)
public class FunctionalRunCuke {
}
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-jvm-deps</artifactId>
<version>1.0.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>gherkin</artifactId>
<version>6.0.14</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>2.1.0</version>
<scope>test</scope>
</dependency>
}
Please suggest what should i do to resolve this
Please use below dependencies in POM & add JUnit/TestNG dependency based on your framework requirement. (Just change v. 4.2.3 to V.4.2.2)
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>datatable</artifactId>
<version>1.1.12</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.2.3</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.2.3</version>
<scope>test</scope>
</dependency>
First of all, remove the cucumber-jvm-deps and the gherkin dependencies, as they might interfere with transitive dependencies from cucumber 4.2.2.
Second, if you want to use Cucumber with JUnit, you'll also need to import Junit (v4.12; as v5 is not yet supported by Cucumber). And you'll want to remove the cucumber-testng dependency (or vice versa, if you want to use TestNg, remove cucumber-junit and you'll probably need a TestNg dependency).
Finally, you might need to update import statements, if their locations have changed in the new Cucumber version.
issue was because of using wrong set of cucumber dependencies. Below is correct set of Cucumber dependencies which shall be used while migrating to 4.0.0 and please note -
1. All the Cucumber dependencies shall be of same version.
2. Use JUnit or TestNG as per your framework requirement.

Import JSF 2.3 in POM file

I tried to import JSF dependency in order to use JSF 2.3 but I get error:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.0</version>
</dependency>
Failed to collect dependencies for [org.glassfish:javax.faces:jar:2.3.0 (compile)
Which implementation should be better to use?
This will do the job
<dependency>
<groupId>javax.faces</groupId>
<artifactId>javax.faces-api</artifactId>
<version>2.3</version>
<scope>provided</scope>
</dependency>

Apache POI usage with Apache Felix

I'm trying to import Apache POI to Atlassian Jira Plugin for reading excel files.
At the beginning, I started with adding just
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
poi.version is 3.14
then when I started the plugin it gave
Unresolved constraint in bundle com.tezExtensions [165]: Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=com.sun.javadoc)
Then I edited pom with some instructions which I found on another StackOverflow question Pax Exam issue with Apache POI wrapped bundle
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<!-- Add package to export here -->
<Export-Package>com.sony.poc.api,</Export-Package>
<_exportcontents>
org.apache.poi.*;version=${poi.version},
org.openxmlformats.schemas.*;version=${poi.schema.version},
schemasMicrosoftComOfficeExcel.*;version=${poi.schema.version},
schemasMicrosoftComOfficeOffice.*;version=${poi.schema.version},
schemasMicrosoftComOfficePowerpoint.*;version=${poi.schema.version},
schemasMicrosoftComVml.*;version=${poi.schema.version},
org.etsi.uri.*;version=${poi.security.version}
</_exportcontents>
<!-- Add package import here -->
<Import-Package>
com.sun.javadoc;resolution:=optional,
com.sun.tools.javadoc;resolution:=optional,
org.apache.crimson.jaxp;resolution:=optional,
org.apache.tools.ant;resolution:=optional,
org.apache.tools.ant.taskdefs;resolution:=optional,
org.apache.tools.ant.types;resolution:=optional,
junit.framework.*;resolution:=optional,
junit.textui.*;resolution:=optional,
org.junit.*;resolution:=optional,
org.apache.xml.security.*;resolution:=optional,
org.apache.jcp.xml.dsig.internal.dom.*;resolution:=optional,
org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
<DynamicImport-Package>
org.apache.xmlbeans.*,
schemaorg_apache_xmlbeans.*
</DynamicImport-Package>
With this configuration, I get this error;
Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver)
Is there anyone have an idea?
Finally, I found a solution.
I have added these as dependency
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
<exclusions>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.4.1</version>
</dependency>
And also added these are to inside of Import-Package tag
*;resolution:=optional, com.ctc.wstx.stax.*
That's all.

Create a RichFaces JSF application on tomcat without using jboss app server

I know that RichFaces is maintained by JBOSS; what I'm trying to do is to add JSF/RicFaces to an existing maven based dynamic web project.
I would like to know if it is possible to use RichFaces without using JBOSS server? I'm using tomcat 6
What dependencies should I mention in my pom.xml?
Currently I've following in my POM, but I don't think that they are sufficient.
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
<version>3.2.2.GA</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.2.2.GA</version>
</dependency>
Any help will be great!
You don't need any specific application server for RichFaces. Any container that can run a Servlet is fine, such as Tomcat. Add the following dependencies in your pom.xml file in addition to your regular JSF 2.x dependency and you will be set. Rest of the dependencies are pulled automatically.
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
</dependency>
Also note that you want to use a version of RichFaces greater than 4.x, 4.3.3.Final being the latest, as that is the version that has full support for JSF 2.0 and 2.1. For full JSF 2.2 support wait for RichFaces 5.0.x, which is in alpha at the moment.
Here is an example of a working setup with the dependencies that may be of interest. It's from a project running in production on Tomcat 6.
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.3.3.Final</version>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
<version>3.3.3.Final</version>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
<version>3.3.3.Final</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_12</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2_12</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.11</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.el</groupId>
<artifactId>el-ri</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>

Resources