POI XSSF : javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found - Error - eclipse

I'm having this problem in a RCP Aplication.
A little Introduccion.
My App is build with Eclispe Indigo 32 bits.
I have two projects, one is mainly a library container, and the other project is the main application, and it have a relation to the Library Project, all in one Elipse Workspace.
A few year ago, I was reading xls files, but now I need to read and write xlsx, and xlsm files.
So I downloaded all POI binary files (poi-bin-3.16-20170419).
I managed to add jar files in library Project, so the source filesgive me NO errors.
But when I run the application I get this error:
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
I try to reorder jar files in "Java Build Path"-> "Order and Export", but the error is the same.
I'll add some screen captures.
Here I try to put Stax-api-xx.jar first, because javax.xml.stream.FactoryFinder is in two libs, jre_1.6 and stax-api !
Where is the error ?
A sneak peak of my workspace:
Best regards

Delete the javax/xml folder from local repository and try building the project again.
This will solve the issue in some cases.

Related

Eclipse not attaching source automatically

I am using Eclipse Oxygen. Everything was working fine until one day I imported a Spring Boot maven project which has problem in pom.xml saying that tools.jar is missing. In the process of trying to remove this error I messed around with build path and many things. Now Eclipse is no longer able to automatically attach sources and I have to manually attach the source. For example, see below image
The source jar file actually exist but eclipse is not able detect it.
I have to manually click the "Attach Source" and locate the source file, and then only the source code is attached. Eclipse should be doing this under the hood. I googled a lot but all solutions given were not working for me. Please help.

Compile Adobe Flash Builder project with Flex SDK command line

I have inherited a Flash Builder 4.6 project, but cannot get the Eclipse FB to compile the project, and now my 60 days has lapsed.
I got fed up with being sent in circles by Eclipse/Fb and now I want to try and sanitise/understand the process by building manually using Flex SDK 4.6.
Trouble, is I do not know where to start. There is the MXMLC.exe and CompC.exe, there are projects within the workspace with inter-depedencies.
Simple example using ANt exists where the chap is only compiling from a single source file.
In my workspace I have a main project folder with sub-folders like src containing .as, .mxml, .png files and sub0fodlers like "assets". At the src root folder there is the main mxml which maps to the final compiled exe.
The project also has a "libs", "bin" "bin-release" folder.
The referenced projects are similar.
One of the referenced projects is "flerry".
I want a single Windows Perl/BAT scipts that will compile this for me.
Any ideas on where to look?
mxmlc.exe is used to compile the application, compc.exe is used to compile libraries. If you have code library dependencies, you'll first need to compile these and then compile your application.
The documentation on compiling is pretty good and can be found here: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fcc.html
I would suggest you give this a go and post specific questions if you run into issues.

Referencing a GWT project from another GWT one - Problems

I am already using an open source GWT project (iServe) and I would like to integrate into it another open source GWT project (PetalsBPM), by which I mean being able to call it and reference its methods.
I have imported iServe in Eclipse (it has multiple modules) as separate Maven projects referencing its other and can run it successfully through Runas -> Web application in development mode.
If I do that and run the other project through the console as mvn gwt:run, I call initiate PetalsMBP through iServe. However, that means that the two programs have to run as is, without communication with each other.
I have also imported the second project into eclipse as a java project successfully (converting into a Maven one causes problems - various lifecycle configurations ones), but whenever I try to add to to iServe through Properties -> Java Build Path -> Projects, although it does not cause any errors immediately, I cannot launch iServe anymore. It produces the following error:
"Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:...iserve-sal-gwt-1.0.0-SNAPSHOT"): CreateProcess error=206, The filename or extension is too long"
Are my problems related to the fact that PetalsBPM is not a Maven project in Eclipse (I doubt it)?
Am I doing something wrong, i.e., this is not the way to reference a project from another one? should I add a reference to the first project's (iServe) gwt.xml file?
Is there a way to do what I want without having to wrap the second project as a jar and calling it from iServe? I would prefer not to, since producing a jar every time I make a slight change is not exactly efficient!
P.S: The second project is a regular GWT project with an entrypoint, not just a module. Should I remove this?
UPDATE: Trying to figure out the source of this error, I attempted to simplify the problem, so I performed the following moves:
I created two new simple GWT projects and tried to reference one
from the other. Worked fine
I referenced the project I actually want
to use (PetalsBPM) from the simple one I just created. Also works
fine.
I referenced the new simple project from the original one I
want to use (iServe). Also works fine.
Tried doing what I actually
want to do, copying the settings from 2&3. Produces the same error
"CreateProcess error=206, The filename or extension is too long" if
I reference PetalsBPM (does not when I remove it from the referenced
projects)
So, I tried switching workspaces. I created a new workspace in C:\, and moved the actual projects there. Still it did not work. :(
Any more ideas?
I met the same type of error "Create Process, error=206, path too long etc." a hundred times.
Then, I found a solution/explanation in google-groups, it solved my problem.
I post the content and link as it might help others.
This website (StackOverflow) really helped me a thousand times.
Thanks to you all !
solution/explanation :
(Response from Stephen Johnson)
(...) if you're using eclipse plugin go to Project | Properties, choose
Google \ App Engine \ ORM and only include directories that you have
classes that you want enhanced. By default it does the entire project
so that includes a lot of needless files. (...)
Link :
original post # google-groups
Read the exception message again. Somewhere along the way Maven is generating a path that is too long for (some) Windows API to handle, try moving your workspace to a directory straight below C:\.
I just tried "skolima" reply and it worked for me. In Eclipse I clicked File->Switch Workspace.
Three things to note:
After I created the workspace in "C:\workspace" I had to update my Project->Properties > Java Build Path > Libraries > Add External JARs...
I'm using Windows 7.
I'm using "Eclipse Java EE IDE for Web Developers"
I hope this others.

How to set reference to the folder which contains multiple jar files?

My environment:
Netbean 6.9.1
Glassfish 3.0.1
Windows 7
Goal:
When my coworkers opens the Netbean Project, the library is already referenced without them manually create library, adding jars into it and reference it.
Detail:
I created Netbean project and the project has reference to few jar files in the folder.
Currently whoever opens the project for the first time, they have to manually create library and refer it to the project.
My project location:
C:\Users\masatosan\Desktop\myProject\myApp
My library location:
C:\Users\masatosan\Desktop\myProject\lib\myLib
The myLib folder contains:
some1.jar
some2.jar
some3.jar
I can achieve my goal if I create reference to individual jar file by defining to project.properties file like below: (creating reference to sqljdbc4.jar)
file.reference.sqljdbc4.jar=../lib/sqljdbc4.jar
javac.classpath=\
${libs.restlib_gfv3ee6.classpath}:\
${file.reference.sqljdbc4.jar}:
But my case is different since I have 3 jars in the myLib folder and wanting to reference them all.
Is it possible to reference all jars in myLib folder?
Please let me know if you need more clarification.
I'm sorry, but it doesn't work that way. When you create a project, you have to add the jar files individually.
However, if you put your lib folder under your project, netbeans will refer to them via relative paths. Then when you share the project (lib directory included), netbeans will be able to automatically find the jar files when the next person uses the project. That way you only have to add jar files once.
Short of using a dependency management tool like maven (which Netbeans has good support for), this is really the best solution. It uses a bit more disk space (obviously), but that's never been a huge issue for me.
I figured how so let me share.
Tool --> Library then library window pop up.
Create library called "MyLib" which contains multiple jars.
Add "MyLib" to your project. This change will be written to project.properties file under nbproject folder.
project.properties file indicates the classpath of lib reference you just added.
It should look like something below
javac.classpath=\
${libs.Excella.classpath}:\
${libs.MyLib.classpath}
Now someone else opens the project from different machine and she just needs to do step#1 and #2, which is to create library with same library name i.e. "MyLib"
I think this is what Bill was saying originally but thought it would be helpful to give step by step instructions since I finally figured .... after long time :D

How can I use Sun's JAI-ImageIO with an Eclipse BIRT plugin?

I'm trying to write an extension (plug-in) for Eclipse BIRT reporting. It involves extracting images from a file according to database entries and displaying them.
I am using Sun's JAI-ImageIO to access TIFF file data and convert to PNG for display within the report. My code complies, but throws a NoClassDefFound runtime exception:
SEVERE: Error happened while running the report.
java.lang.NoClassDefFoundError: javax/media/jai/PlanarImage
at org.eclipse.birt.sample.reportitem.rotatedlabel.util.GraphicsUtil.createDocImage
(GraphicsUtil.java:66)
at org.eclipse.birt.sample.reportitem.rotatedlabel.RotatedLabelPresentationImpl.onRowSets
(RotatedLabelPresentationImpl.java:136)
at org.eclipse.birt.report.engine.extension.ReportItemPresentationBase.onRowSets
(ReportItemPresentationBase.java:218)
at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.
processExtendedContent(LocalizedContentVisitor.java:966)
...
I am using the PlanarImage.getAsBufferedImage() method, so it should convert to a more standard image object. I have placed the JAI jar files in my JRE and tested the same basic code outside of the Eclipse plugin environment -- that works fine. It appears to be a CLASSPATH problem, but I've verified that all JREs on my system contain the necessary jar and DLL files in the appropriate places.
For a new JDBC driver, you must place the jar(s) in a special sub-directory of plugins -- is there a special place to put other third-party jars so BIRT can use them?
This has been solved in Eclipse extension for opening TIFF type 4 images. Basically you just need to make a subdirectory and place all the JARs and DLLs in it, add the jars to your classpath and add the DLLs to the "plugin dependencies" under "required native libraries".