Discussion:
How to Resolve "Indirectly referenced from required .class files" Issue?
Eliot Kimber
2018-07-31 22:18:36 UTC
Permalink
I'm trying to set formatting properties on runs where the XWPFRun class does not provide a setter, e.g., the "em" (emphasis mark) property.

Using the code XWPFRun as a model, I'm trying to do this:

CTEm em = pr.isSetEm() ? pr.getEm() : pr.addNewEm();

However, in Eclipse, I get this compilation error:

The type org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEm cannot be resolved. It is indirectly referenced from
required .class files

I assume this means I am missing some dependency in my project but I'm not sure what it might be.

I have these two POI-related dependencies in my POM:

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>

Are there more dependencies I need or some other setting in Eclipse?

Thanks,

Eliot
--
Eliot Kimber
http://contrext.com




---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
pj.fanning
2018-07-31 23:29:38 UTC
Permalink
poi-ooxml depends on poi-ooxml-schemas and this latter jar has the most
commonly used XMLBeans generated classes for the OOXML xsds. CTEm appears to
be missing from this jar.
We can add it for the 4.0.0 release.
ooxml-schemas has the full set of generated classes. We will be releasing
v1.4 of this jar with poi 4.0.0.
It is built with the rest of the poi jars (if you building locally).



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Mark Murphy
2018-08-01 03:59:12 UTC
Permalink
CT Classes are added to the poi-ooxml-schemas jar based on unit tests. If
the class is used by a unit test, it is included in the jar. I generally
use the full schema in ooxml-schemas for development so I don't hit that
issue. And you should always add unit tests for new code, and examples so
that others can use your code.
Post by pj.fanning
poi-ooxml depends on poi-ooxml-schemas and this latter jar has the most
commonly used XMLBeans generated classes for the OOXML xsds. CTEm appears to
be missing from this jar.
We can add it for the 4.0.0 release.
ooxml-schemas has the full set of generated classes. We will be releasing
v1.4 of this jar with poi 4.0.0.
It is built with the rest of the poi jars (if you building locally).
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
Eliot Kimber
2018-08-01 11:40:29 UTC
Permalink
Note that I'm getting this error in the context of a standalone project, not the POI code itself.

However, I can do the work I'm doing in POI in order to extend the XWPFRun API and for that I would of course create unit tests (what kind of monster would not create a unit test for a new method?).

Cheers,

E.
--
Eliot Kimber
http://contrext.com


On 7/31/18, 10:59 PM, "Mark Murphy" <***@gmail.com> wrote:

CT Classes are added to the poi-ooxml-schemas jar based on unit tests. If
the class is used by a unit test, it is included in the jar. I generally
use the full schema in ooxml-schemas for development so I don't hit that
issue. And you should always add unit tests for new code, and examples so
that others can use your code.
Post by pj.fanning
poi-ooxml depends on poi-ooxml-schemas and this latter jar has the most
commonly used XMLBeans generated classes for the OOXML xsds. CTEm appears to
be missing from this jar.
We can add it for the 4.0.0 release.
ooxml-schemas has the full set of generated classes. We will be releasing
v1.4 of this jar with poi 4.0.0.
It is built with the rest of the poi jars (if you building locally).
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Murphy, Mark
2018-08-01 12:13:13 UTC
Permalink
LOL, There is a lot of old stuff that doesn’t have unit tests. If you are regularly making use of CT classes, then you might want to consider using the full ooxml-schemas jar.

-----Original Message-----
From: Eliot Kimber [mailto:***@contrext.com]
Sent: Wednesday, August 01, 2018 7:40 AM
To: POI Users List <***@poi.apache.org>
Subject: Re: How to Resolve "Indirectly referenced from required .class files" Issue?

Note that I'm getting this error in the context of a standalone project, not the POI code itself.

However, I can do the work I'm doing in POI in order to extend the XWPFRun API and for that I would of course create unit tests (what kind of monster would not create a unit test for a new method?).

Cheers,

E.
--
Eliot Kimber
http://contrext.com


On 7/31/18, 10:59 PM, "Mark Murphy" <***@gmail.com> wrote:

CT Classes are added to the poi-ooxml-schemas jar based on unit tests. If
the class is used by a unit test, it is included in the jar. I generally
use the full schema in ooxml-schemas for development so I don't hit that
issue. And you should always add unit tests for new code, and examples so
that others can use your code.
Post by pj.fanning
poi-ooxml depends on poi-ooxml-schemas and this latter jar has the most
commonly used XMLBeans generated classes for the OOXML xsds. CTEm appears to
be missing from this jar.
We can add it for the 4.0.0 release.
ooxml-schemas has the full set of generated classes. We will be releasing
v1.4 of this jar with poi 4.0.0.
It is built with the rest of the poi jars (if you building locally).
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org For additional commands, e-mail: user-***@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail:
pj.fanning
2018-08-01 12:31:36 UTC
Permalink
I've already added artificial tests to ensure the CTEm class is included in
future versions of poi-ooxml-schemas.jar.
The full ooxml-schemas jar is published to maven and it is just a
convenience for poi to default to using the much smaller
poi-ooxml-schemas.jar.



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org

Continue reading on narkive:
Loading...