Weblog von admin

show soap message of JAXWS / wsimport generated Java clients

To show the raw SOAP message you could set the following values:


com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump = true
com.sun.xml.internal.ws.transport.http.HttpAdapter.dump_threshold = 64000;

they could be set using the debugger or the -D parameter used to execute the program.

here you could see a older older Version using System Propertys

System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");

awesome wm menu bug

if you get issues using CTRL+P with a error message pointing to : init.lua that looks like this:

nil argument to `ipairs` at menubar/init.lua:152
(my version v3.5.7 and all around it)

you should edit:

vim /usr/share/awesome/lib/menubar/utils.lua

and add the following lines around Line 177:


-- Substitute Exec special codes as specified in
-- http://standards.freedesktop.org/desktop-entry-spec/1.1/ar01s06.html

-- LINES TO ADD:
if program.Name == nil then

pmd mass path change

Falls es mal zu folgenden Fehler kommen sollte, dann muss man die .pmd definition der XML orte aktualisieren.
Die Fehlermeldung lautet:
An internal error occurred during: "ReviewCode". Couldn't find the class Can't find resource rulesets/basic.xml. Make sure the resource is a valid file or URL or is on the CLASSPATH.

und ist mit folgendem Kommand für die gesamte Projektstruktur zu beseitigen:

find . -name .pmd -exec sed -i.bak 's/rulesets\/basic.xml/rulesets\/java\/basic.xml/g' {} \;

GFTP Password descrumble

if you want to descrumble gftp passwords from the bookmark file you can use the command decode.py

you need to search for the password=$SOMETHING inside of the bookmark file. Than you code use the

decode.py \$SOMETHING

to decode the password. But keep in minde to escape the $ for shell users. You need to add a leading backslash to the password. Otherwise there will be no useful output.

based on the code of:
http://www.g-loaded.eu/2009/05/07/descramble-passwords-from-gftp-bookmar...

apache virtual hosts after update

if your subdomains got lost after updating your apache, this may be related to a new default setting.
To test this, you can try to enable your missing subdomain.

a2ensite YOURSUBDOMAIN

if you get a "ERROR: Site YOURSUBDOMAIN does not exist!" you should have a closer look to your /etc/apache2/sites-availble directory. If your files does not end with .conf they woundn't be found anymore.

if you want to rename them

find . -print0 -not -name "*.conf" | xargs -n 1 -0 -I {} mv {} {}.conf

and you should be able to a2ensite them again.

Analyse Image based PDF Files for Text content (great for Fax services)

If you have to analyse image based texted files (like from a fax or scanner), you could try to use a OCR software like tesseract. It works quite well and you can reorganise a complete new source for information.

For myself, i made a script to translate incomming faxes (pdf) files, convert them and store them in my wiki (as file annotated with the textual content). Searchable and semantic annotatable.

i simply use following commands (see attached file):

#!/bin/bash

if [ $# -eq 1 ]; then

Java development with XML Files, Best practice

Developing with XML files could be aweful in Java. Thanks God they invented a toolchain which makes development easy again:

Create your destination XML File

use "trang" to konvert it to XSD File

usd XCJ to convert it to super clean JAXB Java code.

hybris view tenant data (for Unit - Tests Logs for example)

if you want to switch to the tenant for your JUNIT Tests you could add the tenantID parameter like this:

http://localhost:9001/hmc/hybris;tenantID=junit

to your URL and review all the logs from junit tasks.

the same works for plattform init:
http://localhost:9001/platform/init;tenantID=junit

Magento WS-I Compliance mode, fixing the WSDL

If you try to generate code from the WS-I Compliance WSDL of the magento soap service you may run into the problem that:

{urn:Magento}[message:catalogProductAttributeRemoveResponse] not exist.

in Version 1.7.2 (CE) and Magento Enterprise 1.12.0.2 this is not fixed.
I found a solution. Someone on stackoverflow fixed the wsi.xml and made a diff file. I did the same changes and added the file so you do not need to update the file by yourself.

file can be found under:
app/code/core/Mage/Catalog/etc

mysql utf8 convert

here a easy way to convert your mysql database to utf8:

mysqldump -u hybris -p --default-character-set=latin1 --skip-set-charset hybris > hybrisdump.sql
iconv -f ISO8859-1 -t UTF-8 hybrisdump.sql > dump_utf8.sql
sed -r 's/latin1/utf8/g' dump_utf8.sql > hybrisdump_utf.sql

mysql -u hybris -p --execute="DROP DATABASE hybris; CREATE DATABASE hybris CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql -u hybris -p --default-character-set=utf8 hybris < hybrisdump_utf.sql

Inhalt abgleichen