Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nestor cruz
IPC LIb JasperReport error
November 28, 2017 12:03 PM
Answer

Nestor cruz

Rank: Junior Member

Posts: 29

Join Date: February 14, 2015

Recent Posts

Greetings community

I have a problem using jasperreport with ipc, everything works fine without using the library, when I include the library, it throws this error

 118:55:02,459 ERROR [http-nio-8080-exec-2][render_portlet_jsp:131] null
 2java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.portlet.Event.getQName()Ljavax/xml/namespace/QName;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, com/munaysoft/historialPagos/handler/ClienteIdEventHandler, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, javax/portlet/Event, have different Class objects for the type javax/xml/namespace/QName used in the signature
 3    at com.munaysoft.historialPagos.handler.ClienteIdEventHandler.handleEvent(ClienteIdEventHandler.java:23)
 4    at com.liferay.faces.bridge.internal.BridgePhaseEventImpl.execute(BridgePhaseEventImpl.java:127)
 5    at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:136)
 6    at javax.portlet.faces.GenericFacesPortlet.processEvent(GenericFacesPortlet.java:602)
 7    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:87)
 8    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:58)
 9    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:107)
10    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
11    at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletExceptionAdapter.service(ServletExceptionAdapter.java:68)
12    at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
13    at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
14    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
15    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
16    at com.liferay.portal.osgi.web.wab.extender.internal.adapter.FilterExceptionAdapter.doFilter(FilterExceptionAdapter.java:46)
17    at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
18    at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
19    at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
20    at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
21    at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
22    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:530)


I'm using
liferay 7.0
faces.api.version 2.2
iferay.faces.bridge.ext.version 5.0.1
liferay.faces.bridge.impl.version 4.1.0
mojarra.version 2.2.14

for jasper Report use
groupId: net.sf.jasperreports
artifactId: jasperreports
version: 6.4.0

Beforehand thank you very much
Neil Griffin
RE: IPC LIb JasperReport error
November 28, 2017 2:08 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2514

Join Date: July 26, 2005

Recent Posts

Hi Nestor,

I tried to reproduce the problem by adding the following dependency to a simple Java portlet project:
1        <dependency>
2            <groupId>net.sf.jasperreports</groupId>
3            <artifactId>jasperreports</artifactId>
4            <version>6.4.0</version>
5        </dependency>


But that caused approximately 40 transitive dependencies to be added to the project:

WEB-INF/lib/aopalliance-1.0.jar
WEB-INF/lib/bcmail-jdk14-1.38.jar
WEB-INF/lib/bcmail-jdk14-138.jar
WEB-INF/lib/bcprov-jdk14-1.38.jar
WEB-INF/lib/bcprov-jdk14-138.jar
WEB-INF/lib/bctsp-jdk14-1.38.jar
WEB-INF/lib/castor-core-1.3.3.jar
WEB-INF/lib/castor-xml-1.3.3.jar
WEB-INF/lib/commons-beanutils-1.9.0.jar
WEB-INF/lib/commons-collections-3.2.2.jar
WEB-INF/lib/commons-digester-2.1.jar
WEB-INF/lib/commons-lang-2.6.jar
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/core-3.2.1.jar
WEB-INF/lib/ecj-4.3.1.jar
WEB-INF/lib/icu4j-57.1.jar
WEB-INF/lib/itext-2.1.7.js5.jar
WEB-INF/lib/jackson-annotations-2.1.4.jar
WEB-INF/lib/jackson-core-2.1.4.jar
WEB-INF/lib/jackson-databind-2.1.4.jar
WEB-INF/lib/jakarta-regexp-1.4.jar
WEB-INF/lib/jasperreports-6.4.0.jar
WEB-INF/lib/javax.inject-1.jar
WEB-INF/lib/jcommon-1.0.23.jar
WEB-INF/lib/jfreechart-1.0.19.jar
WEB-INF/lib/lucene-analyzers-common-4.5.1.jar
WEB-INF/lib/lucene-core-4.5.1.jar
WEB-INF/lib/lucene-queries-4.5.1.jar
WEB-INF/lib/lucene-queryparser-4.5.1.jar
WEB-INF/lib/lucene-sandbox-4.5.1.jar
WEB-INF/lib/olap4j-0.9.7.309-JS-3.jar
WEB-INF/lib/spring-aop-3.0.6.RELEASE.jar
WEB-INF/lib/spring-asm-3.0.6.RELEASE.jar
WEB-INF/lib/spring-beans-3.0.6.RELEASE.jar
WEB-INF/lib/spring-context-3.0.6.RELEASE.jar
WEB-INF/lib/spring-core-3.0.6.RELEASE.jar
WEB-INF/lib/spring-expression-3.0.6.RELEASE.jar
WEB-INF/lib/stax-1.2.0.jar
WEB-INF/lib/stax-api-1.0-2.jar
WEB-INF/lib/stax-api-1.0.1.jar

My recommendation would be that you <exclude> all of these transitive dependencies, and only add back the ones that you really need.

In particular, I think that the error you reported is caused by the presence of stax-api.jar in WEB-INF/lib. It's actually included twice: Version 1.0.1 and 1.0-2.

Kind Regards,

Neil
Nestor cruz
RE: IPC LIb JasperReport error
November 29, 2017 7:47 AM
Answer

Nestor cruz

Rank: Junior Member

Posts: 29

Join Date: February 14, 2015

Recent Posts

Thanks Neil for the quick response

I tell you that I made the following exclusion and does not throw the error

 1  <dependency>
 2    <groupId>net.sf.jasperreports</groupId>
 3    <artifactId>jasperreports</artifactId>
 4    <version>6.4.3</version>
 5   
 6
 7    <exclusions>
 8        <exclusion>
 9            <groupId>stax</groupId>
10            <artifactId>stax</artifactId>
11        </exclusion>
12        <exclusion>
13            <groupId>javax.xml.stream</groupId>
14            <artifactId>stax-api</artifactId>
15        </exclusion>
16    </exclusions>
17    </dependency>


but it still does not work, I've related tests in a portlet that does not have ipc, and it worked perfectly, for these tests I have not made exclusions
this problem is being generated when jasperReport is run together with ipc
Neil Griffin
RE: IPC LIb JasperReport error
November 29, 2017 7:53 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2514

Join Date: July 26, 2005

Recent Posts

Hi Nestor,

When you wrote "IPC" were you referring to "Inter Portlet Communication" or something else?

Also, I recommend excluding ALL of the transitive dependencies and only adding back the ones that are truly needed at runtime, one-at-a-time, testing to see which one causes things to not work.

Finally, I would need more details as to why it still does not work, meaning any server side or client-side error messages.

Kind Regards,

Neil
Nestor cruz
RE: IPC LIb JasperReport error
November 29, 2017 1:48 PM
Answer

Nestor cruz

Rank: Junior Member

Posts: 29

Join Date: February 14, 2015

Recent Posts

effectively ipc = inter Portlet Communication

I commented that I put the suggestions into practice but I did not find a solution to the problem and the only error that is displayed is the aforementioned

to give solution to the need to create a pdf I used itext5

I thank you for the help given and any suggestion will be well received
Neil Griffin
RE: IPC LIb JasperReport error
November 29, 2017 2:06 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2514

Join Date: July 26, 2005

Recent Posts

Hi Nestor,

If your requirement is to simply export a PDF, then I recommend that you take a look at our jsf-export-pdf-portlet demo. The source can be found here.

It uses a JSF 2 ResourceHandler in conjunction with the Portlet 2.0 RESOURCE_PHASE in order to provide a downloadable PDF.

Kind Regards,

Neil

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!