Java based Web application I'm working on is deployed on IBM Websphere (WAS 8.5) running on AIX server. Wep app is dependent on using PrinceXML tool for generating PDFs out of html and css. Prince does not have AIX binaries.
Any suggestions to workaround this?
I would suggest you setup (or use an existing) webservice for the PrinceXML end of things.
DocRaptor is a service that uses PrinceXML for HTML to PDF generation: https://docraptor.com/
Or you could setup a simple inside-the-firewall webservice (running on something that is not AIX) that takes in HTML and pipes it to PrinceXML, and spits back a finished PDF.
You may also want to look into getting the open-source wkhtmltopdf (http://wkhtmltopdf.org/) to compile on AIX, if you need PDF generation, but not married to PrinceXML for doing so. (Though I cannot find anywhere in a cursory google search that has done it, so I'm not sure if it is possible).
In case anyone is interested :
We went with a java based tool called PDFreactor. It runs on JVM so meets our requirement to deploy on AIX.
CSS support is comparable to PrinceXML tool.
Related
I have a linux-based nodejs web application that I need to generate reports from and I have chosen Pentaho for this.
I have installed biserver-ce (5.4) which works, however this is an overkill as it uses tomcat which is a behemoth and uses huge amounts of CPU and memory (1.5GB+) which I don't have a lot of, and furthermore I do not require any user console, user management or security etc etc or any of the other features that biserver offers.
Currently the requests are sent to biserver:8080 by nodejs back-end and the resulting pdf report is then piped to the client's front-end browser using nodejs.
As far as I understand, tomcat is simply converting a http request and returning the rendered pdf, and since I already have a web server with nodejs this seems a bit redundant, and I want to bypass tomcat entirely.
So I am looking to eliminate tomcat and either have a server listening on a socket or simply send the report parameters via the command line, but having googled this for the last half day, I am still unable to find a definitive answer or example of how I can generate pentaho reports without using tomcat.
Can this be done ? I have good javascript skills but zero java programming abilities, Can I use just the parts of biserver that generate the reports and eliminate tomcat completely ?
I have moved the compiling issue to a different thread.
It does appear possible to at least embed the reporting engine into a standalone Java application. This does require you to have some knowledge about Java and the Pentaho SDK, but it may be your only non-Tomcat option. There is a complete example Java project here that shows you how to accomplish this (code is mostly in Sample1.java).
I have already referred this question on SO but it is not the solution I'm looking for.
I'm a Java Web Developer, and so far for all CSS pre-processing needs, I've been using Less but now I want to move Sass due to its server-side rendering nature. But since it requires gem package manager and thus is more closer to Ruby then Java, how can I adopt it in my Java Web Applications that I develop in Eclipse?
Note that I'm not looking for Syntax Highlighting feature for .scss/.sass files in Eclipse, but I'd want that when my application is run on server from within Eclipse, the Sass is processed automatically and gets compiled to regular CSS. (Instead of running sass --watch outside Eclipse for each Sass file I create and save and include generated .css file separately in my web pages)
P.S. I'm using both Linux and Windows, but I primarily develop in Linux.
Some years have passed, but finally now there is a viable solution:
https://github.com/eclipse/wildwebdeveloper#-get-it-now
Integration of the Wild Web Developer with Eclipse is easy. It will compile your SCSS files to CSS files once they are changed. Besides this it supports lots of other features, such as code completion, code highlighting, validation and many more. You will need to install node.js to make use of all its features.
I need to decide between various Java technologies to install on a Linux server.
My back end (biz logic) is a Java program that must communicate with C functions using JNI. This Java program also must communicate with Oracle database (11G) using JDBC on one side, and BlazeDS residing in a Java-based Application Server on the other side (to communicate with Flash plug-in on client side). I also need an HTTP web server.
Not knowing much about Java, I wonder what the highest performance (e.g. fastest) and/or cleanest solution might be.
For example, should I install JDK on the server to provide JNI functionality, then then use Tomcat for everything else? Or, does Tomcat also include JNI? Or would something like JBoss which includes J2EE and serveletts capability be better, since it does everything in one package?
Just trying to learn any conventional wisdom about possible solutions, and pros and cons about going one way versus another.
Any Java runtime environment can do JNI - so by implication if you have any application server (e.g. Tomcat or JBoss) running then you should be able to do JNI just fine.
Tomcat would be perfectly fine for what you are describing.
It's a popular lightweight application server
It supports servlets and JSPs so works well for serving HTML
It's probably a bit simpler to get started with than a full JBoss setup
On the other hand JBoss is great as well.
More of an "Enterprisey" focus - you can optionally get excellent commercial support from Red Hat
Might make sense if you wanted to leverage some of the other products in the JBoss ecosystem
I basically think both would serve your needs. I'd probably suggest writing a simple servlet-based application and try deploying it to both Tomcat and JBoss to see which one you prefer. If you stick to standard servlet features then your app should run on both Tomcat and JBoss so you can keep your options open.
The other thing to consider early is tool support - make sure you get comfortable and happy with your Java IDE tooling for your app development. My personal choice is Eclipse, which has great support via plugins for both JBoss and Tomcat. But most of the other major Java IDEs like IntelliJ IDEA or Netbeans should serve your purposes as well.
G-WAN is an HTTP server (critera #3) which executes Java scripts that can use Jar and other Java classes (criteria #2) while at the same time run C/C++ scripts (criteria #1).
The advantage of this solution is that you will have only one program running (no intermediate layers, no wrappers).
Disclamer: I am involved in the development of this project.
I need a Java interface to the OpenOffice document conversion which would equal to a manual (Open... and then Save As...) as well as access to the PDF generation.
The following are some example of what I want to achieve.
1) Open one type of document (fx. OpenOffice Writer document or Microsoft Office document) onto memory and save it in another supported format.
2) Open one type of document into memory and export it as PDF.
I have gone through http://api.openoffice.org but didn't get any material which can help me to get started.
I also tried JODConverter but it requires me to run OpenOffice as a service.
I wold prefer to include all the core functionality of OpenOffice in one JAR file so that that the user can use my application without installing or running openoffice on their PC.
What would be a URL/code snippet from where I can get tutorials to get started?
Also do I have to add some JAR files?
Will the application work even if I don't have OpenOffice installed on my PC?
You might want to have a look at noa-libre (Nice Office Access, formerly available at ion.ag). It's a Java API that wraps OO.o's native Java API to be easier to use. It allows you to quickly "remote control" OO.o.
Also tell me if i have to add some jars?
Yes, that is documented.
Will the application work even if i dont have open office not installed on my pc?
No, the application requires a running (!) instance of OO.o, as it essentially remote-controls OO.o. The instance can in theory run on another computer (controlled via network).
try the ODF Toolkit project . it has an API that allows you to manipulate openoffice documents without having openoffice.org installed in your client machine.
here is a good article that get you started with ODF toolkit : Integrate OpenOffice with Java without Installing OpenOffice
I once used OpenOffice for MS Word to PDF conversion. Although it was the only free solution, I wasn't quite satisfied with the resulting PDF file, specially when your document has complex bidi scripts.
For conversion, as far as I can remember, there was two possible ways. One to use OS pipes and the other was socket or something. I don't have my code right now, but the only thing you need is to search in that URL. You should first launch an OpenOffice executable file (I just followed a simple turorial in OpenOffice wiki) with some parameters, and then run your Java application, using provided Java libraries.
I am on a Java learning spree recently, however I am normally a .NET developer. (So please forgive my newbie questions.)
In .Net I can develop ASP.Net pages without using IIS, as it has a watered down web server (Cassini, I think it's called).
Does Java or a Java IDE have something similar so I can write and test JSP and Java Servlets without the need of a full-blown app server (Tomcat etc.)?
Also if there is one, does it work on Windows?
Tomcat actually isn't a fullblown appserver. It's just a servlet container (i.e. implementing only web component of the (indeed huge) Java EE API) It's only around 6MB big. Glassfish, JBossAS, Weblogic and Websphere as being full Java EE API implementations may be called as "fullblown appservers".
You can also consider Eclipse Jetty. It has a small footprint (download is only 2.2MB) and is useable as an embedded server and even runnable from a plain vanilla Java class.
As to IDE's, both Tomcat and Jetty are by default supported in "Eclipse for Java EE developers". You can easily integrate them in Servers view and then just associate your web project with it. Here's a nice video tutorial how to get started with servlet development with Eclipse and Tomcat.
As to working on Windows, Java is platform independent. You just need to have a platform-compatible JRE installed. Then any Java software will be able to run on the particular platform. Sun has a JRE for Windows --which is by the way also included in the JDK, if you already have one.
In the Java world the usual way to develop JSP based applications is to have a web container like Tomcat inside the IDE, and there are many ways to do it.
The easiest way to get started is to use Netbeans with a bundled web container - download the "Java" one from http://netbeans.org/downloads/index.html and install it.
After starting Netbeans 6.8, "File -> New project", choose "Java Web" to the left, and "Web application" to the right, and "Next". "Next". "Next". "Finish".
The editor now opens on "index.jsp" in a new project. Select "Debug -> Debug Main Project" and after a while a browser opens showing "index.jsp".
Switch back to Netbeans. Insert this line
<%= new java.util.Date() %>
just before the </body> end tag, and save with Ctrl-S (or "File -> Save").
Switch back to the browser. Reload the page. See the date shown. Repeat :)
That's it.
You can hook up your ant scripts to hot deploy to a local tomcat instance. That's the closest thing I can think of to the .NET development environment.
Eclipse can embed a dev version of Tomcat, and most other IDEs offer a dev server too, I should think.
But also I should also point out that obtaining & setting up Tomcat is quite a bit simpler than setting up IIS. Just download a zip file and unzip -- poof! you're done!
When I was playing with JSP a while back I used NetBeans which has a Web & Java EE-installer, that
Provides tools for developing Java SE,
Java EE, and web applications. This
download option also includes the
GlassFish V2 UR2 application server
and Apache Tomcat software.
Try Jetty http://jetty.codehaus.org/jetty/
Jetty is an Open Source HTTP Servlet Server written in 100% Java. It is designed to be light weight, high performance, embeddable, extensible and flexible, thus making it an ideal platform for serving dynamic HTTP requests from any Java application.
EDIT: corrected link.