Advertisements

Tuesday, August 8, 2017

How to escape text when pasting into Eclipse (including XML)

When you paste text into Eclipse it does just that - places where the cursor is in it's full un-altered original form. This is fine most of the time apart from when you might want to copy a chunk of XML (or a similar large body of text). What you end up with in this case is the text pasted in with red lines everywhere because the text hasn't been properly escaped for Java code.

To enable escaping of pasted text open the Preferences panel ('Window' menu -> 'Preferences...' option), then choose: 'Java' -> 'Editor' -> 'Typing' and tick the box which says "Escape text when pasting in a string literal":


Now whenever you post in text which is broken over multiple lines, Eclipse will insert the relevant quotes of Java to make Eclipse happy.

source: 
http://blog.andrewbeacock.com/2009/06/how-to-escape-text-when-pasting-into.html

How to mount a share folder in Linux using Vbox

In this section I'm going to show how to mount a share folder using windows (host) and Linx Mint (Guest).

Here are the steps.

1.- Install the guess tools.
go to Devices -> Install Guest Additions and double-click the CD that pops up on your desktop

2.- Make an empty directory you want to mount to

mkdir ~/NewShareFolder

3.- Now to perform the mount itself

sudo mount -t vboxsf ShareWin /ShareWin

4.- Crear el link a desktop using

ln -s /media/sf_share ~/Desktop/share

then add the group vboxsf to user eddocg

By doing this, you are granting permission to enter to /media/sf_share folder

sudo usermod -a -G vboxsf eddocg

Next time you logout or restart the VM you will be able to use the shared folder

Note: I'm assuming before doing all of this you setup the share folder in vbox itself. (add this in the future)

If it doesnt work we have to add the user to the group vboxsf

usermod -a -G vboxsf eddocg

then go to menu->Administration-> user and group
 
 
And that’s it. But if you want a permanent share, it’s even easier. When adding a permanent share, be sure to tick the “auto-mount” box – this means you won’t have to enter a mounting command every time you start up Linux again. Once you reboot, you’ll find the share mounted at /media/sf_sharename. Of course, that’s not terribly handy, so why not make a symlink to it (a shortcut)?
In this example I’m going to assume, again, that my share’s name is My_Dropbox, and I want to create a shortcut to it from the Desktop:
ln -s /media/sf_My_Dropbox ~/Desktop/Dropbox The nice thing about permanent shares is that they’re, well, permanent, so you’ll never have to go through this procedure again unless you’re mounting another share.
And that’s it, now the writing on your hard drive is easily accessible from inside your virtual machine.
 

Thursday, January 5, 2017

Guide for JMS and Active MQ

Here are some notes to start working with Active MQ.

Download from ‘Downloads’ section on ActiveMQ’s webpage, extract it to any directory and run the ‘activemq’ program from beneath the ‘{path-where-you-extracted-activemq}/bin’ directory:

execute: activemq start





Now the ActiveMQ server is up and running. ActiveMQ has a nice admin console, where you can see a lot of useful informations and change the settings:

The default username and password is admin/admin

Wednesday, June 8, 2016

How to enable AMQP in JBoss Fuse

Here are some steps of how to enable AMQP in JBoss Fuse.

1.- Configuring ports:

Edit etc/io.fabric8.mq.fabric.server-broker.cfg:
------------------------------------------------------------------------
amqpBindPort=5672
amqpSslPort=5671

Note: amqpSslPort needs extra configuration to enable SSL.


2.- Configuring amqp broker:

Edit etc/activemq.xml:
------------------------------------------------------------------------

 
 



3.- Enabling amqp feature so we can use it in camel context

Install karaf feature:
------------------------------------------------------------------------

features:install camel-amqp

Restart fuse.

Tuesday, October 27, 2015

Maven problem - NoHttpResponseException and I/O exception

This issue is related with the internet protocol version 6 of the network I'm working so it will be fixed adding the java arg to the command.

i.e.

mvn clean package -Djava.net.preferIPv4Stack=true

Monday, October 26, 2015

Eclipse/JdevStudio - Unable to connect to updates repositories

I'm getting an error every time I try to install something with Eclipse:

Error:



This can be fixed using this java arg variable:

-Djava.net.preferIPv4Stack=true

We have to put this argument at the end of the file "eclipse.ini" and restart the IDE. (for Jdevstudio is jbdevstudio.ini)


Now I'm able to see whats under the repository.




I think the reason why is not working is because the current network I'm using doesn't support the newer network protocol IPv6(which is the most recent version), so we have to tell eclipse to go back to IPv4.


Thursday, April 23, 2015

OER 12c - how to unlock admin user

Before starting the default credentials for admin user is:
admin/weblogic1

Now if you got this locked, you  need to do the following.

1.- Stop the oer instance.

2.- Login into the OER databse schema and perform the following commands


update OER1_OER.ENTSECUSERS set ACTIVESTATUS=0 where USERNAME='admin';


select * from OER1_OER.ENTSECUSERS where username='admin';


select * from OER1_OER.CMEEUSERS where ENTSECUSERID='99';


update OER1_OER.CMEEUSERS set ACTIVESTATUS=0 where ENTSECUSERID='99';


commit;


3.- Start oer instance again.