Special character encoding issue on Solaris with weblogic server - pdf

I have an application which uses fop and xslt to generate the PDF file. The special characters as §£?ÐÅÆ are appearing as ???? in PDF.
The weblogic server is running on solaris machine.
I have already tried with
<charset-params>
<input-charset>
<resource-path>/*</resource-path>
<java-charset-name>UTF-8</java-charset-name>
</input-charset>
<charset-mapping>
<iana-charset-name>UTF-8</iana-charset-name>
<java-charset-name>UTF-8</java-charset-name>
</charset-mapping>
</charset-params>
in weblogic.xml.
I have also tried with
transformer.setOutputProperty( OutputKeys.METHOD, "xml");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.setOutputProperty( OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
Nothing seems to be working over there.

Have you set up fop to find fonts with those characters in? For instance, on Solaris 11
using fop (though not with weblogic) I had to set up paths for fonts in a fop-conf.xml:
<?xml version="1.0"?>
<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register all the fonts found in a directory -->
<directory>/usr/share/fonts/TrueType/core/</directory>
<directory>/usr/share/fonts/TrueType/dejavu/</directory>
<directory>/usr/share/fonts/TrueType/liberation/</directory>
<directory>/usr/share/fonts/TrueType/unifont/</directory>
<!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
<!-- directory recursive="true">C:\MyFonts2</directory -->
<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>
</renderer>
<renderer mime="application/postscript">
<fonts>
<directory>/usr/share/fonts/X11/Type1/</directory>
<directory>/usr/share/ghostscript/fonts/</directory>
<directory>/usr/share/fonts/TrueType/core/</directory>
<directory>/usr/share/fonts/TrueType/dejavu/</directory>
<directory>/usr/share/fonts/TrueType/liberation/</directory>
<directory>/usr/share/fonts/TrueType/unifont/</directory>
</fonts>
</renderer>
</renderers>
</fop>
(Font paths will be different on older versions of Solaris.)
For more details, see:
http://xmlgraphics.apache.org/fop/trunk/fonts.html
http://www.sagehill.net/docbookxsl/AddFont.html#ConfigFontFop

Related

PDF output: Apache FOP or <cfdocument> tag using coldfusion 11

I am moving coldfusion 9 window to coldfusion 11 linux. I have an application that is to generate PDF output. The last developer utilized Apache FOP library to depoly PDF outputs many years ago:
<CFSaveContent Variable="FOData">
<CFOutput>
<!-- root of document, set common attributes, will be inherited by all lower tags -->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
font-family="serif"
font-size="12pt"
text-align="left">
...
</CFSaveContent>
</CFOutput>
It doesn't work running on Coldfusion 11. I have blank page(s) on PDF output. I have Apache FOP 0.20. I downloaded new version FOP 2.0. I found out there are many changes need to be done on my source codes if I use new FOP.
My question is should I keep this FOP depolyment or switch to <cfdocument format="PDF"> tag.
Any suggestion?
Thanks.

How do I change the default location for mule application log files?

I would like to change the log directory from MULE_HOME/logs to MULE_HOME/logs/apps. The only place I have found that refers to a file path is in MULE_HOME/conf/wrapper.conf. Editing the wrapper.logfile does allow me to relocate the mule_ee.log file, which seems to be the Mule application log, but I'd like to include Mule application logs there, too. If I create an application called FOO and deploy it to the runtime environment, it will create a file called MULE_HOME/logs/mule-app-FOO.log, but changing the location seems to be difficult short of completely messing things up writing custom log4j2 XML files.
If you have Mule version 3.6+, then it is recommended to use log4j2.xml instead of log4j.xml.... Using log4j2 you can change the path and get your application log ... a simple example would be :-
<RollingFile name="RollingFile" fileName="${env:MULE_HOME}/logs/${sys:CustomapplicationName}.log"
filePattern="${env:MULE_HOME}/logs/${sys:CustomapplicationName}-%d{yyyy-MM-dd}-%i.log"> <!-- CustomapplicationName is set at mule-app.properties or in VM argument in Run As Configure as -DCustomapplicationName=Log4j -->
<PatternLayout>
<pattern>%d{dd/MMM/yyyy HH:mm:ss,SSS}- %c{1}: %m%n</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="120 KB" />
</Policies>
<DefaultRolloverStrategy max="1" />
</RollingFile>
Just put this above code in your log4j2.xml in src/main/resource folder
Here in above you can see that, you have configured your path of your log files by mentioning here:-
<RollingFile name="RollingFile" fileName="${env:MULE_HOME}/logs/apps/${sys:CustomapplicationName}.log"
filePattern="${env:MULE_HOME}/logs/apps/${sys:CustomapplicationName}-%d{yyyy-MM-dd}-%i.log">
where ${sys:CustomapplicationName} is the System variable set in mule-app.properties as following :-
CustomapplicationName=yourApplicationName
Right way is to have log4j properties / xml file for FOO application and have that define the desired path for FOO application log. This way will ensure mule_ee.log is not messed up and at the same time other applications too will have their own log files which will be easy to manage and easy to introspect specific application log in case of errors / exceptions
Define location in log4j.properties file.

Update To JRE7, can not load nativelib jar, but JRE6 works fine

For my JNLP file , there is some nativelib info like below:
<resources os="Windows">
<nativelib href="lib/x264-win.jar" />
</resources>
<resources os="SunOS" arch="sparc">
<nativelib href="lib/x264-SunOS-sparc.jar" />
</resources>
<resources os="SunOS" arch="x86">
<nativelib href="lib/x264-SunOS-x86.jar" />
</resources>
When I Update To JRE7, can not load nativelib jar, but JRE6 works fine.
The load nativelib code like below:
String source = "x264.jar";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url= cl.getResource(source);
"x264.jar" is one jar in x264-win.jar,lib/x264-SunOS-sparc.jar or lib/x264-SunOS-x86.jar.
When I used JRE6 to load x264.jar, it worked fine.
But when I updated to JRE7, it can not load x264.jar.
When use JRE6, url would be"x264.jar" info, like jar:http://test.local:8080/JNLP.jar!/x264.jar,
but use JRE7, url would be null, and I found code not load nativelib "x264.jar"
Does any one have find JRE7 can not load nativelib.jar?
Is the problem of using Thread.currentThread().getContextClassLoader() to load "x264.jar"?
Ensure that you have the correct bitwise native binary to match your JRE. If you are testing on a 64-bit JRE, you need a 64-bit native binary. If you're testing on a 32-bit JRE, you need a 32-bit native binary. You might need to include resources for each of these three:
<resources os="Windows" arch="amd64">
<resources os="Windows" arch="x86_64">
<resources os="Windows" arch="x86">
I had similar trouble ; however even in JRE 6 this didn't get this to work.
Found a bug that could be related to that :
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6758884
Apparently JRE can have trouble downloading nativelib resources.
The bug is still opened, and targeted towards version 8 of java ...
The following "dll relying" applet is working fine (besides the security problems when using 1.7.0_51 (you need to decrease the security settings to medium since it is self signed)).
So if the native lib loading mechanism of the jnlp file is broken then you can distribute your .dll files alongside a normal jar file like in the upper example.
Put the dlls/sos in your jar file like in the example: jssc.jar
Load the libraries with System.load(libFolderPath + fileSeparator + libName); like used here.
As mentioned by Joseph please note the fine grained version differentiation between win, solaris, linux, arm and i86 and amd64 bit systems. So if you e.g. don't supply a 64Bit dll and run it with 64Bit Java it won't work...
I had forgot I solved this a while ago. I found that I had to handle this in Java code with System.loadLibrary( "jarNameNoExtension" );
Hopefully that helps others.

ADOBE AIR : Error #16824 : Version mismatch while trying to auto update

OBJECTIVE :
So here is my problem, I am trying to auto-update an old version software X v1.0.7 AIR Runtime SDK 2.0 to a new version X v1.0.8 AIR Runtime SDK 2.5.
CONFIGURATION =
Old Software X is version 1.0.7 using runtime SDK 2.0. App.xml as follow :
<application xmlns="http://ns.adobe.com/air/application/2.0">
<version>1.0.7</version>
This software X is so, suppose to update to version 1.0.8 which suppose to use the AIR runtime 2.5.
Im using an update.xml file with tags :
<update xmlns="http://ns.adobe.com/air/framework/update/description/1.0">
<version>1.0.8</version>
The computer is MacOS X v10.6.6. running the latest AIR RUNTIME 2.5
The new version of the old software X, version 1.0.8, is using an app.xml as follow :
<application xmlns="http://ns.adobe.com/air/application/2.5">
<versionNumber>1.0.8</versionNumber>
<publisherID>#my hidden publisherID#</publisherID>
The software X v1.0.8 is using the tag publisherID so the software would be recognized as the same software.
WHAT HAPPEN ?
When I launch the old software X v1.0.7, it is trying to update and raise the error 16824. This error is suppose to mean that my version of the new software does not match the version defined in the update.xml file but to me, its not true... so what is wrong ? Anyone can help ?
The solution is here :
http://kb2.adobe.com/cps/873/cpsid_87300.html
If you're trying to follow the instructions in the knowledge base article, you'll find that it tells you what to do but not how to do it. You're told to include the updated applicationupdater.swc and applicationupdater_ui.swc from Air 2.5 / Flex 4.5 but that is the hardest part.
In Flash Builder do this:
Go to "Project Properties", "Build Path"
Unfold the Flex Framework in the list and remove applicationupdater.swc and applcationupdater_ui.swc.
Click "Add SWC" and add those two files from your Flex 4.5 framework location (/Applications/Adobe Flash Builder 4.5/sdks/4.5.0/frameworks/libs/air/applicationupdater.swc on Mac).
If you're using the mxmlc task in an Ant buildfile, this has worked for me:
<target name="compile" depends="css, copy_assets">
<mxmlc file="${MAIN_SOURCE_FILE}" output="${OUTPUT}/${FLEX_APP_NAME}.swf">
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
<compiler.source-path path-element="${APP_ROOT}/src"/>
<compiler.source-path path-element="${APP_ROOT}/locale/{locale}"/>
<!-- append=false clears your library-path -->
<compiler.library-path dir="${FLEX_HOME}" append="false">
<!-- Now we need to re-add the flex libs -->
<include name="libs"/>
<include name="locale/{locale}"/>
</compiler.library-path>
<compiler.library-path dir="/" append="true">
<!-- Add the updater framework from Flex 4.5 / Air 2.6 -->
<include name="Applications/Adobe Flash Builder 4.5/sdks/4.5.0/frameworks/libs/air/applicationupdater_ui.swc"/>
<include name="Applications/Adobe Flash Builder 4.5/sdks/4.5.0/frameworks/libs/air/applicationupdater.swc"/>
<!-- You may need to adjust these paths -->
</compiler.library-path>
<compiler.library-path dir="${FLEX_HOME}" append="true">
<!-- Re-add the rest of the air libs -->
<include name="libs/air"/>
</compiler.library-path>
<compiler.library-path dir="${APP_ROOT}/libs/" append="true">
<!-- Your custom libraries here -->
</compiler.library-path>
</mxmlc>
</target>
An equivalent set of commandline options should work for the mxmlc command line compiler, but I haven't tested this:
mxmlc -library-path=$(FLEX_HOME)/libs $(FLEX_HOME)/locale/{locale} \
$(FLEX45_HOME)/frameworks/libs/air/applicationupdater.swc \
$(FLEX45_HOME)/frameworks/libs/air/applicationupdater_ui.swc \
$(FLEX_HOME)/frameworks/libs/air \
... your custom libs \
... other compiler options
I have described the entire process with a bit more background information on my blog.
The error occurred for me because versions number in my compiled application was different than the version number in the UpdateDescriptor.xml on the server.
In an AIR application the version number is defined in the application descriptor file under the tag versionNumber:
<versionNumber>2.3.0</versionNumber>
In the UpdateDescriptor.xml file on the server I had a different number:
<?xml version="1.0" encoding="utf-8"?>
<update xmlns="http://ns.adobe.com/air/framework/update/description/2.5">
<versionNumber>2.2.1</versionNumber>
<url>http://www.example.com/project_2.2.1.air</url>
<description><![CDATA[List the changes in this version here]]>
</description>
</update>
It resulted in this error:

Getting Hello World in AIR to install

I have an AIR application that is the following:
<h1>Hello World</h1>
It runs on my local machine:
C:\inetpub\wwwroot\AIR\HelloWorldDestination.air
And it runs if I choose "preview in Adobe AIR" in Dreamweaver.
But I can't get it to download and install from my website.
Here is the application.xml that Dreamweaver created:
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/2.0">
<filename>HelloWorldFileName</filename>
<copyright>Hello World Copyright</copyright>
<description>Hello World Description</description>
<customUpdateUI>false</customUpdateUI>
<name>HelloWorldAppName</name>
<id>com.PhillipSenn.HelloWorldID</id>
<version>1</version>
<initialWindow>
<content>HelloWorld.htm</content>
<height>600</height>
<width>800</width>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
</initialWindow>
</application>
It's giving me an error 2032.
I have uploaded these files as well:
AC_RunActiveContent.js
badge.swf
HelloWorldDestination.air
Here's my line of code in Index.htm:
'flashvars','appname=HelloWorldAppName&appurl=http://www.PhillipSenn.com/AIR/HelloWorldDestination.air&airversion=2.0&imageurl=css/Install.gif',
When I create the AIR file, Dreamweaver gives me the following warning:
In order to install this application
on your machine, you need the Adobe
AIR runtime that can be downloaded
from: http://www.adobe.com/go/air
The application to be installed cannot be found at http://www.phillipsenn.com/AIR/HelloWorldDestination.air