martes, 10 de mayo de 2016

Visual Studio Code toggle line comment in non-english keyboard

The defaulr Ctrl+/ key binding for Toggle Line Comment doesn't work in my machine (spanish keyboard). To get the real key binding mapping in a specific environment, just

F1  Open Keyboard Shortcuts


and look for the specific shortcut. In my case, "editor.action.commentLine"


there I can see the real binding in miy machine is Ctrl+}




miércoles, 4 de mayo de 2016

Create a clean and complete EAR project with Maven (ear, war, ejb modules)

These orders are taken from the ones Netbeans uses when you create a New → Maven → Enterprise Application. It uses some nice archetypes from org.codehaus.mojo.archetypes:

cd C:\apps

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root -DarchetypeVersion=1.1 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=co.com.acme -DartifactId=myApp -Dversion=1.0-SNAPSHOT -Dpackage=co.com.acme.app -Dbasedir=C:\apps -Darchetype.interactive=false --batch-mode archetype:generate

cd C:\apps\myApp

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ear-javaee6 -DarchetypeVersion=1.5 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=co.com.acme -DartifactId=myApp-ear -Dversion=1.0-SNAPSHOT -Dbasedir=C:\apps\myApp -Darchetype.interactive=false --batch-mode archetype:generate

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=webapp-javaee6 -DarchetypeVersion=1.5 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=co.com.acme -DartifactId=myApp-web -Dversion=1.0-SNAPSHOT -Dbasedir=C:\apps\myApp  -Darchetype.interactive=false --batch-mode archetype:generate

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ejb-javaee6 -DarchetypeVersion=1.5 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=co.com.acme -DartifactId=myApp-ejb -Dversion=1.0-SNAPSHOT -Dbasedir=C:\apps\myApp -Darchetype.interactive=false --batch-mode archetype:generate

Resulting structure:


It is needed however to include some dependencies between the projects:

Edit C:\apps\myApp\myApp-ear\pom.xml and include:


    <dependencies>
        <dependency>
            <groupId>co.com.acme</groupId>
            <artifactId>myApp-ejb</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>co.com.acme</groupId>
            <artifactId>myApp-web</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>war</type>
        </dependency>
    </dependencies>

Example:


Then you can do a C:\apps\myApp>mvn install obtaining the following EAR:





martes, 26 de abril de 2016

Docker (docker-machine) build and disk space notes (Windows)

Docker Toolbox version: 1.10.3
Docker info server version: 1.10.3
Operating System: Boot2Docker 1.10.3
Windows: 7

Working with somewhat big images, I started receiving disk space errors when running docker build ("no space left on device" when executing ADD, etc.). Although my images are big, I knew they're not that big to fill the default 20GB Docker Machine Virtual Box VM disk (located in C:\Users\[User]\.docker\machine\machines\default), so before resizing its VirtualBox vmdk file, I started looking around.


I ssh'ed to the docker-machine host:

docker-machine.exe ssh


Tracing the wasted disk space (df -k, du -sh *,...) I ended up in the /mnt/sda1/var/lib/docker/tmp directory.


(note: the screenshots doesn't reflect the actual disk space in the problem's instant).

The docker user doesn't have permissions to see that directory, so you need to sudo sh.



I noticed several large docker-builder* directories storing the context for building some of my images (the Dockerfile and installers and assets needed by the build, etc....). After doing some tests building images, I noticed this directory is really a temporary directory (duh) and should not contain those docker-builder* folders if you are not actually building images (as I was not at the moment).

I deleted the folders, re ran the builds and they finished without space problems.

What caused docker not removing those temporary directories automatically? Maybe some Ctrl-C's I did when just "Sending build context to Docker daemon..." or interrupted builds?

martes, 16 de febrero de 2016

OSB 12c: "No acceptable representation for response..." invoking REST service

Error: No acceptable representation for response with "application/xml; charset=iso-8859-1" media type was found

service> AbstractResponseMessage.getPart, com.bea.alsb.ws.codec.
CodecException: No acceptable representation for response with "application/xml; charset=iso-8859-1" media type was found
com.bea.alsb.ws.codec.CodecException: No acceptable representation for response with "application/xml; charset=iso-8859-1" media type was found
        at com.bea.wli.sb.service.handlerchain.handlers.OutboundRestHandler$AbstractResponseMessage.getPart(OutboundRestHandler.java:373)
        at com.bea.wli.sb.service.handlerchain.handlers.OutboundRestHandler$AbstractResponseMessage.getPart(OutboundRestHandler.java:316)
        at com.bea.alsb.ws.codec.internal.runtime.soap.SoapDocCodec.marshallBody(SoapDocCodec.java:67)
        at com.bea.alsb.ws.codec.internal.runtime.soap.SoapCodec.marshall(SoapCodec.java:147)
        at com.bea.alsb.ws.codec.internal.runtime.soap.SoapDocClientCodec.marshall(SoapDocClientCodec.java:58)
        at com.bea.wli.sb.service.handlerchain.handlers.OutboundRestHandler.handleResponse(OutboundRestHandler.java:208)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler$1.handleResponse(AbstractHandler.java:307)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.handleResponse(AbstractHandler.java:139)
        at com.bea.wli.sb.service.handlerchain.handlers.OutboundMessageContentHandler.handleResponse(OutboundMessageContentHandler.java:89)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler$1.handleResponse(AbstractHandler.java:307)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.handleResponse(AbstractHandler.java:139)
        at com.bea.wli.sb.service.handlerchain.handlers.LoadBalanceFailover$LoadBalanceFailoverHelper.handleResponse(LoadBalanceFailover.java:475)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.handleResponse(AbstractHandler.java:139)
        at com.bea.wli.sb.service.handlerchain.handlers.UpdateOutboundStatistics.handleResponse(UpdateOutboundStatistics.java:89)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler$1.handleResponse(AbstractHandler.java:307)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.handleResponse(AbstractHandler.java:139)
        at com.bea.wli.sb.service.handlerchain.handlers.EndpointManagementHandler.handleResponse(EndpointManagementHandler.java:122)
        at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler$1.handleResponse(AbstractHandler.java:307)
        at com.bea.wli.sb.service.handlerchain.handlers.TransportProviderInvoker$ServiceTransportListener.onReceiveResponse(TransportProviderInvoker.java:302)
        at com.bea.wli.sb.transports.http.wls.rest.RestOutboundMessageContext$Reply.run(RestOutboundMessageContext.java:467)
        at weblogic.work.WorkAreaContextWrap.run(WorkAreaContextWrap.java:55)
        at weblogic.work.ContextWrap.run(ContextWrap.java:40)
        at com.bea.alsb.platform.weblogic.WlsWorkManagerServiceImpl$WorkAdapter.run(WlsWorkManagerServiceImpl.java:194)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
>

This error can be caused by a mismatch between the type of response you specified in the adapter and the real response the REST service is returning.

For example, if you specified that the service returns HTTP 200 OK with a JSON body, but the service returns just HTTP 200K withouth payload (body).



OSB: 12.1.3


viernes, 29 de enero de 2016

Exitvalue 71 starting WebSphere MQ 8 QM

WebSphere MQ for Windows (x64 platform): 8.0.0.4

If you look at the Windows Event Viewer, you will find a more detailed error detail (hopefully) referencing an FDC file in:

C:\ProgramData\IBM\MQ\qmgrs\[QM name]\errors

Look at the file header of the FDC; in my case, the problem was a "file access denied":



Looking carefully you can find more detailed information below:



Filename of stanza file passed to fopen: C:\ProgramData\IBM\MQ\qmgrs\LOCAL_QM\qmstatus.ini. strerror from fopen: Permission denied.




jueves, 28 de enero de 2016

Java, middleware, programming and general tech twitter accounts to follow







JBoss and Netbeans: enable listen on all network interfaces


Append -Djboss.bind.address=0.0.0.0 to JBoss' VM Options.



(JBossAS [6.1.0.Final "Neo"]).