martes, 23 de octubre de 2012

Passing values containing commas in the jndiProperties parameter of GenericJMSRA

I'm trying the Open Source Glassfish's Generic Resource Adapter for JMS (GenericJMSRA aka GenericRA) and need to supply a value that contains commas for one of the provider specific parameters of the jndiProperties parameter.

I have for example this jndiProperties's value (used to work with Websphere Application Server JMS resources): 

java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory,
java.naming.provider.url=corbaloc::myhost1:9810,:myhost1:9811,
com.ibm.CORBA.ORBInit=com.ibm.ws.sib.client.ORB,
java.naming.security.principal=USERNAME,java.naming.security.credentials=PASWORD

As you can see, the value of the java.naming.provider.url sub-parameter contains a comma, but the global jndiProperties value is also comma separated. GenericRA supports "special" character scaping, so you can do this:

java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory,
java.naming.provider.url=corbaloc::myhost1:9810\,:myhost1:9811,
com.ibm.CORBA.ORBInit=com.ibm.ws.sib.client.ORB,
java.naming.security.principal=USERNAME,java.naming.security.credentials=PASWORD

BUT, the value that the providers's code is receiving, stills contains the comma: corbaloc::myhost1:9810\,:myhost1:9811, causing errors like the following (in Websphere's case):

Caused by: javax.naming.ConfigurationException: Malformed provider URL: corbaloc::myhost1:9810\,:myhost1:9811 [Root exception is org.omg.CORBA.BAD_PARAM: For input string: "9810\" in 9810\  vmcid: OMG  minor code: 9  completed: No]
    at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1508)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:389)
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113)
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilder.createObject(ObjectBuilderFactory.java:97)
    ... 24 more
Caused by: org.omg.CORBA.BAD_PARAM: For input string: "9810\" in 9810\  vmcid: OMG  minor code: 9  completed: No
    at com.ibm.rmi.corba.IIOPAddrImpl.setPort(IIOPAddrImpl.java:185)
    at com.ibm.rmi.corba.IIOPAddrImpl.(IIOPAddrImpl.java:107)
    at com.ibm.rmi.corba.Corbaloc.parseObjAddr(Corbaloc.java:230)
    at com.ibm.rmi.corba.Corbaloc.parseObjAddrList(Corbaloc.java:184)
    at com.ibm.rmi.corba.Corbaloc.parseCorbaloc(Corbaloc.java:141)
    at com.ibm.rmi.corba.Corbaloc.(Corbaloc.java:119)
    at com.ibm.rmi.corba.ORB.createObjectURL(ORB.java:3890)
    at com.ibm.rmi.corba.ORB.createObjectURL(ORB.java:3853)
    at com.ibm.CORBA.iiop.ORB.createObjectURL(ORB.java:3416)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.parseBootstrapURL(WsnInitCtxFactory.java:1503)
    ... 30 more


I found there's an reported bug that, although is related to other use case, has the same underlying cause: imqAddressList doesn't get parsed properly when passed to resource adapter config.

I found the proposed bug fix works for me, so I'm compiling an "ObjectBuilder" version that contains the fix.

domingo, 30 de septiembre de 2012

Poor performance when updating Asus Transformer Prime TF201 to Android 4.1 (Jelly Bean)

I received and applied the long-awaited official Android 4.1 (Jelly Bean) update to my standard, not rooted Asus Transformer Prime TF201 tablet but in my case the results were not as expected; I didn't feel any of the smoothness and fluidity that I'm used to feel for example on my Galaxy Nexus. Fortunately, everything changed after doing a "Factory data reset" (in Backup & Reset settings); I had to reinstall my apps, but now the tablet runs super fast and super smooth.

:-D

miércoles, 15 de agosto de 2012

Launching Forms Builder and Reports Builder 11g R2 if shortcuts are not created

I followed a nice and simple Oracle Forms 11g R2 installation guide I found in an Oracle presentation in Windows 7 (following the steps for a development environment), but when the installation  finished I noticed the installer didn't create shortcuts to Forms Builder or Reports Builder (Developer). This are the executables I'm using to launch the programs:
  • Forms Builder: C:\oracle\Middleware\Oracle_FRHome1\bin\frmbld.exe
  • Reports Builder: C:\oracle\Middleware\asinst_1\config\reports\bin\rwbuilder.bat 
If I launch Reports Builder from C:\oracle\Middleware_Forms\Oracle_FRHome1\bin\rwbuilder.exe, I get the following error: REP-50125: rwbuilder.conf: java.lang.NullPointerException.


UPDATE: I don't remember if Reports Builder ran successfully at least once. When I really started needing to work with Reports Builder, I tried to launch it using the shortcut previously described, but It didn't start; CMD flashes but Reports Builder just stays in the Windows taskbar, showing no window; even sometimes it crash and Windows shows an APPCRASH report. I searched but didn't find a solution that worked for me. The installer I used was a Windows 64 bits installer. Searching through the forums, I found a My Oracle Support note that describes several problems working with the 64 bits Report Builder binaries in Windows 64 bits; they suggest installing the 32 bits version, even if you are Working in Windows 64 bits. Reference:
  • ALERT : 64-Bit Reports Builder 11gR2 (11.1.2) Problems on 64-bit Windows Operating Systems [ID 1395965.1]
I Installed again the environment usign the 32 bits installer (in my 64 bits Windows) and both tools (Forms Builder and Reports Builder) worked without problems (but my 64 bits servers stoped working; specifically, I started receiving "FRM-93652: The runtime process has terminated abnormally" when I invoked any form; what I did was to delete the references to my 32 bits installation from PATH and LD_LIBRARY_PATH -I deleted LD_LIBRARY_PATH- and rebooted; I saved obviously a backup with the previous values. I should just work with the 32 bits servers, but don't have time to configure them now).

If you are in the same situation as me, temporaly dealing with Forms and trying to get fast your way around, here are other tips (I don't know right now if those are the best or correct way of doing the configurations but have worked for me; all paths and configurations apply for a development environment installation):
  • The FORMS_PATH variable used to tell Forms Builder where to find forms, reports and libraries: can be configured in the Windows registry, in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OHXXXXXXXX key (where XXXXXX is a number that varies; you have to find the correct one). It value can be a list of disc paths, followed by semicolon. If you install the product using 32 bits binaries in a 64 bit system, the key is: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE\KEY_OHXXXXXXX.
  • Database connection configuration: can be specified in the C:\oracle\Middleware_Forms\asinst_1\config\tnsnames.ora file. The related error is "ORA-12154 TNS: Could not resolve the connection identifer specified".
  • default.env and formsweb.cfg files:  
    • Windows dev env: C:\oracle\Middleware\user_projects\domains\ClassicDomain\config\fmwconfig\servers\AdminServer\applications\formsapp_11.1.2\config
    • Linux: /oracle/Oracle/Middleware/user_projects/domains/FormsResportsDomain/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_11.1.2/config
    • In default.env you can configure the FORMS_PATH variable to be used by the server to find forms, reports and libraries.
    • In formsweb.cfg you can change for example the width and height of the forms applet (width and height properties).
    • In default.env you can find the correct values for ORACLE_HOME and ORACLE_INSTANCE for your forms installation.
      • ORACLE_HOME=C:\oracle\Middleware\Oracle_FRHome1
      • ORACLE_INSTANCE=C:\oracle\Middleware\asinst_1
  • Registry.dat file: C:\oracle\Middleware_Forms\user_projects\domains\ClassicDomain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.2\config\forms\registry\oracle\forms\registry\Registry.dat
  • Problem with Java Plugin in Firefox on Windows 7: I'm working with Windows 7 64 bits and Firefox 14. I had to set the exact version of Java JRE I had installed in Windows in formsweb.cfg; I had also to install a 32 bits JRE (even if I am in a 64 bits Windows). References:
  • base.htm , basejpi.htm, etc. files location:
    • /oracle/Oracle/Middleware/asinst_1/config/FormsComponent/forms/server
  • Forms migration assistant: C:\oracle\Middleware\asinst_1\bin\frmplsqlconv.bat
  • httpd.conf location: /oracle/Oracle/Middleware/asinst_1/config/OHS/ohs1/httpd.conf
  • Images (icons) in buttons: I followed the steps in this great post: How to set forms 11g buttons to display icons. Actually, I just followed just some of the steps to successfully show the icons:
    1. Create the icons jar in an arbitrary path (jar -cvf frmicons.jar *.*).
    2. Paste the icons jar in C:\oracle\Middleware_Forms\Oracle_FRHome1\forms\java.
    3.  Edit the archive key in formsweb.cfg to add the icons jar name (the codebase and imageBase keys were already correctly configured acording the instructions); for example: 
      • archive=frmall.jar,frmicons.jar
      • imageBase=codebase
      • codebase=/forms/java
    4. Sign the jar with sign_webutil.bat.
  • FRM-41213 trying to invoke reports from forms: when I first tried to invoke a Report from a Form or Form Menu, I got the following error: "FRM-41213: Unable to connect to report server x". The developers of the Forms app I was trying to deploy were using a parametric table to find the report's server name to use in run_report_object. I didn't know the "report's server name" was a logical name and not the hostname of the server the service is running in; then I tried to set this report's server name to things like the server hostname, its IP address, but none of this worked. I found that name is a logical name you can find through an utiliy called rwdiag.bat. You can do this to find the names of the reachable reports severs: rwdiag.bat -findall. I also found the mechanism through the client can find the reports servers is defined here: C:\oracle\Middleware_Forms\asinst_1\config\ReportsToolsComponent\ReportsTools\rwnetwork.conf; it is using a multicast discovery mechanism by default.
    • rwdiag.bat location for Windows developer environment installation: C:\oracle\Middleware\asinst_1\config\reports\bin\rwdiag.bat.
    • To diagnose this problem, I use the following My Oracle Support note:
      • Diagnosis Test Form for Easy Debugging of FRM-41213 Error (11g) [Video] [ID 880823.1].
      • This note provides a test form that gives you detailed information about the report invocation.
    • Rwdialog invocation example:
  • FRM-41214 Unable to run report: after I fixed FRM-41213, I started receiving FRM-41214. The good news is that if you get FRM-41214, you are getting correctly connected to the reports server. You can look at the following URL to know if the report generation job was registered by the reports server and to see the concrete error: http://localhost:7001/reports/rwservlet/showjobs?server=reports_server_name (reports_server_name is again, the reports server logical name as returned by rwdialog).
  • Nothing happens when calling Reports from form's menu items: I compiled manually some forms and menus from Forms Builder 11g in Windows; some of those menus called reports. The invocation ran OK in Windows. I uploaded the compiled forms, menus and reports to a Linux server and when I clicked menu items which called reports, nothing happened; I saw no errors in the client's Java Console or in the server logs. I recompiled the menus and forms in Linux and everything started working again. I though Forms and Menus were "multi platform" :-\

Extra references:
Tricks:



    jueves, 15 de marzo de 2012

    Configuring Subversion (SVN) in Websphere Integration Developer (WID) 6.2

    I just followed the steps for installing Subversion support in Eclipse Ganymede (3.4) which is the underlying Eclipse which Websphere Integration Developer (WID) 6.2 is based on.

    SVN Team Provider:
    • Help ▶ Software Updates ▶  OK ▶ Available Software ▶ Add Site ▶ http://download.eclipse.org/technology/subversive/0.7/update-site/ ▶ OK ▶ Expand "Subversive Site" ▶ Check Subversive SVN Team Provider Plugin (Incubation) ▶ Install ▶ ... ▶ Restart Eclipse
     SVN Connector:
    • Help ▶ Software Updates ▶ OK ▶ Available Software ▶ Add Site ▶ http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ ▶ OK ▶ Expand "http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/" ▶ Check SVNKit 1.3.5 Implementation (Optional) ▶ Install ▶ ... ▶ Restart Eclipse
    Now you can open SVN Repository Exploring Perspective and add repositories.

    See also Configuring Subversion (SVN) in IBM Integration Designer (IID, formerly WID) 8.

    lunes, 12 de marzo de 2012

    Tutorial de consumo de servicios Web desde Bonita Open Solution (BPM)





    Video que explica como consumir servicios Web desde Bonita Open Solution (la herramienta BPM de Bonitasoft).

    Binding SOAP: "http://schemas.xmlsoap.org/wsdl/http/"

    Ejemplo análisis respuesta usando DOM:

    import javax.xml.transform.dom.DOMSource;
    def output = (DOMSource) response
    output.getNode().childNodes.item(0).childNodes.item(0).childNodes.item(0).childN­odes.item(0).childNodes.item(0).textContent


    (In this video I explain how to consume a Web Service from a business process implemented in Bonita Open Solution -Bonitasoft BPM-)


    jueves, 8 de marzo de 2012

    HL7 with HAPI: OBX-5 is valued, but OBX-2 is not

    Exception: ca.uhn.hl7v2.HL7Exception: OBX-5 is valued, but OBX-2 is not.  A datatype for OBX-5 must be specified using OBX-2. See JavaDoc for Varies#fixOBX5(Segment, ModelClassFactory)

    Look at the HL7 message you're trying to parse. OBX-2 makes reference to the second field (you have to count the "first" "OBX" field as 0). OBX-5 makes reference to the fifth field.

    OBX||[OBX-2_FIELD]|PESO||[OBX-5_FIELD]

    The specification says that the data type for the OBX-5 value is variable and not known until run time. For that reason, that data type is specified in the OBX-2 value. In conclusion, if you set a value in the OBX-5 field, you must specify its data type in the OBX-2 field. For example, the following OBX line is wrong:

    OBX|1||PESO||0

    But the following is OK:

    OBX|1|NM|PESO||0

    If you want to bypass this kind of cases, the HAPI API provides some system properties that let you specify a default value for OBX-2 in case it is empty or with a wrong value:

    System.setProperty(Varies.INVALID_OBX2_TYPE_PROP, "ST");

    and

    System.setProperty(Varies.DEFAULT_OBX2_TYPE_PROP, "ST");

    Reference: http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ParseInvalidObx2Values.html





    miércoles, 7 de marzo de 2012

    Change Websphere Integration Developer (WID) language to English

    By default, Websphere Integration Developer UI language is determined by the computer locale. My OS is installed and configured to use Spanish, but I prefer to use the development tools in English (error messages, tutorials, etc.)

    To force WID to use English, add the following line

    -nl en_US

    to  WID_INSTALLATION_PATH\wid.ini (for example, C:\Program Files\IBM\WID62\wid.ini)

    viernes, 3 de febrero de 2012

    Unresolved WebApp library references defined in weblogic.xml: Extension-Name: jsf

    I was trying to deploy a JSF 2.0 dependent Webapp to a Weblogic 10.3.5 platform which consists of two servers: the AdminServer and other managed server (let's call it X). I was going to deploy the Webapp ONLY to managed server X, so I deployed the JSF library and associated it ONLY to X. I also included the library reference in weblogic.xml. When I deployed the Webapp to X, I got the following error:

    Unresolved WebApp library references defined in weblogic.xml, of module 'XXX.war' [Extension-Name: jsf, Specification-Version: 2, Implementation-Version: 1.0.0.0_2-0-2, exact-match: true].

    When I lost all hope, I associated the library also to AdminServer. I redeployed the Webapp and it deployed without errors. What???

    lunes, 30 de enero de 2012

    "Could not initialize class: sun.awt.X11GraphicsEnvironment" using JT400 AS/400 driver

    If you get a "Could not initialize class: sun.awt.X11GraphicsEnvironment" exception when trying to create a JDBC pool to an AS/400 machine using JTOpen (JT400, com.ibm.as400.access.AS400JDBCDriver), is very probably you have wrong data related to your connection (bad user, bad password, etc.). This driver have a very odd behaviour which tries to show a graphical window when some errors occur (producing the error in headless environments). Try establishing the connection first with an universal JDBC client like DBVisualizer or write a Java class to make the connection manually to confirm your connection settings.