Thursday, July 31, 2008

Apache derby-client ij from a windows batch file

To connect ij to a derby-database from a windows batch script seems to be not too well documented, but it turns out to be extremely easy : you can set environment variables in advance. (I wanted to use the provided batch files for setting the classpath etc.)

@echo off

set DERBY_OPTS=-Dij.user=XXXXX -Dij.password=YYYYY -Dij.database=jdbc:derby://localhost/DATABASENAME

set DERBY_HOME=c:\Program Files\Sun\JavaDB\

"c:\Program Files\Sun\JavaDB\bin\ij.bat"

Labels:

Wednesday, June 06, 2007

TClientDataSet in a BPL

A TClientDataSet in a (dynamically linked) BPL gives EAccessViolation in ntdll.dll 0x10. You can use a TClientDataSet though if you link the module statically instead of using the bpl. See also here and here

Monday, October 23, 2006

Firebird embedded database on Win 98

When using the Firebird database (version 1.5) on windows 98, or (specifically) when deploying applications using the Firebird database to computers with Windows 98.
Problem : 'no dynamic link library "fbclient.dll" found'
  • For win98, first edition : replace \windows\system32\msvcrt.dll by the version fo msvcrt.dll provided in Firebird 1.5 bin-dir in the installation directory.
  • For all versions of windows 98 : put msvcp60.dll which is in the Firebird install dir in the application directory.

Tuesday, September 26, 2006

Deploy Java Studio Creator 2 update 1 applications to Glassfish (PE 9) server

Direct deployment to a 'remote' glassfish V1 or V2 or SJAS 9 server is not possible from Java Studio Creator 2 upd 1. So the way to deploy applications to Glassfish is by building a war, and deploying it from the Glassfish administration console.

When building a WAR in Sun Java Studio Creator, the (server-specific) sun-web.xml file is NOT incorporated in the WAR-archive. This sun-web.xml file is needed for role-mapping, resource-mapping, ...
Also, the JSF libraries are included. In recent builds of Glassfish V1 UR1 and Glassfish V2, this does not lead to exceptions when deploying (as opposed to older builds), but still I noticed errors in the 'System Errors' component when they are included in MySQL-based database-aware applications.

Go to the build.xml-file in the JSC 'files' window, and edit the 'extract-war' target. In this target, comment out the line
delete file="${dist.jar.dir}/tmp/WEB-INF/sun-web.xml" quiet="true"

and add the lines
delete file="${dist.jar.dir}/tmp/WEB-INF/libs/jsf-impl.jar" quiet="true"
delete file="${dist.jar.dir}/tmp/WEB-INF/libs/jsf-api.jar" quiet="true"
delete file="${dist.jar.dir}/tmp/WEB-INF/libs/commons-logging-1.0.4.jar" quiet="true"
delete file="${dist.jar.dir}/tmp/WEB-INF/libs/commons-digester.jar" quiet="true"
delete file="${dist.jar.dir}/tmp/WEB-INF/libs/commons-collections.jar" quiet="true"
delete file="${dist.jar.dir}/tmp/WEB-INF/libs/commons-beanutils.jar" quiet="true"
Now build the application, and the war will contain sun-web.xml, while the JSF libraries included in the Glassfish server will be used instead of the ones from JSC.

Important note when using MySQL 4.1.x on Ubuntu (from the standard package) with Connector/J 3.1.x : Server side prepared statements are used by this connector, and they are broken in this MySQL-version. Set the connection parameter useServerPrepStmts=false from the Glassfish administration console when setting the connection pool. Symptom of this problem : JSC created databound tables show up empty with a note 'No Items Found', while no error messages are shown or logged.

Monday, August 21, 2006

Reportman v 2.5g in BDS2006 with windows 98 (win98)

If reportman.sf.net version 2.5 g is installed in BDS2006, (see other post in this blog), and the resulting executable is ran on windows 98, an error 'a required dll could not be found, activeDS.dll' occurs. This is because in the 'required' section of the package rppack_del2005.bsdproj of reportman, a reference to soaprtl is present (which needs inet100, which needs activeds.dll). Remove the reference to soaprtl from this package in the project manager window (in the requires section), and edit the file rpdatainfo.pas : remove WSDLIntf from the uses clause (under the ifdef USEVARIANTS-test).

Friday, July 07, 2006

Firefox/mozilla can not open local links

I found this in google groups (sorry, lost track of a reference to the author) when looking for a way to make firefox open links to local files :

For firefox 1.5 : go to the url
about:config
and search for
security:checkloaduri
and set it to false.

Per site : in prefs.js :
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://www.example.com");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

The line w

ith capability.policy.localfilelinks.sites can have multiple websites separated by spaces, like so: user_pref("capability.policy.localfilelinks.sites","http://www.example.com http://www.example.net");

Installation of Zeos DBO and reportman in BDS 2006 for use with C++ builder

At Digon bvba, Zeos DBO is used for database connectivity (to Firebird and MySQL), and ReportMan (by Tony Martir) for reporting. Installing Zeos (version available early 2006, version 6.6.2 (RC) ) and Reportman (version 2.5.g and 2.7.e) was quite a job. The procedure described here seems to work.

First install ZEOS in the delphi-personality, but make the packages yourself (make new packages, and add modules). For each package, in 'options/linker', the checkbox 'generate all c++ builder files' should be switched on (to make them available in the c++ personality).

Important : make sure the new packages you create have the correct names, so 'ZCore', 'ZPlain', ... or else they will be installed again by the next step (the reportman-installation).

Important : if you have, aside from BDS 2006, also C++ builder 6 installed on your computer, name the packages 'ZCore100', 'ZPlain100', because otherwise the existing C++Builder6 bpl's may mistakenly be used if they are first in the path (and cause a lot of trouble) !

Reportman installation : if you have called the packages 'Z----100' (because you want to maintain a C++builder6 installation on the same PC), then you have to specify in the 'requires' part of the reportman packages the 'Z---100' names for the packages.

In the reportman source-files, you must REMOVE ALL REFERENCES to Indy (comment them out). The reportman Indy does not cooperate with the Indy components in BDS2006. More specifically : switch 'UseIndy' off in reportman.inc, and comment out everything in the files 'rpprotocol', 'rpmetaclient' and others in which references to indy-components occur. (Leave only the pascal-keywords 'implementation', ..., and put the rest between

{$IFDEF USEINDY}.... {$ENDIF} .

)

Install Reportman in the delphi personality, use the bdsproj-files for delphi2005. Follow the instructions on the reportman-website. Also specify 'generaty c++ builder files' for each package.

Important : close and restart BDS after each 'install' of a set of reportman components, otherwise the reportman package will not show in the c++builder-personality (well, maybe closing after each step is not required (?) , but if reportman is not available afterwards, remove all reportman components (menu 'component', 'Install packages', select reportman related components and click 'remove' ), close and restart bds, and start over installing in the correct order, restarting bds after each install.

Labels: , , ,

Netbeans java web service with delphi consumer.

Problem : After creating a web service with netbeans 5.0 bundled with Sun Java System Application Server 8.2, and publishing it on localhost, then using the delphi BDS 2006 WSDL importer to create a delphi module, and then calling webservice methods from delphi, exceptions arise.
  • If NO message handler is included in the web service, the exception reads <>
  • If a default message handler is added to the web service (right click the web service, configure handlers, add), the exception is JAXRPC.TIE.04: Internal Server Error (JAXRPCTIE01: caught exception while handling request: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl
Solution :
  • Make sure there is NO message handler for the webservice (remove it)
  • Right click on the webservice, go to the options, select the 'web service' page, and set 'document literal' OFF, and standard RPC ON.
  • On the Delphi side, open the WSDL-importer generated module, go to the initialization-part (below), and change the ioLiteral parameter from the RegisterInvokeOptions to ioDefault (default means : RPC-style encoding of the soap message).