The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)

20130528

eclipse - change workspace default font for editors and console output

if you want to change the default workspace font for pretty much everything, like editing:
java files
xml files
html files
console output
etc

all you have to do is this:
window > preferences > type "font" where it says "type filter text" > select "colors and fonts" > type "java" where it says "type filter text" in the "colors and fonts" configuration window > select "java editor text font" and click the button "edit default", then choose your new font size, e.g. 7

that's it! :)

i set it to as small as i can read so i can see the greatest amount of text as possible when i'm coding and debugging

20130523

how to install libsvn-java 1.6 on ubuntu 13.04

ubuntu 13.04 uses libsvn-java 1.7, but my previous eclipse setup was configured for version 1.6, so here's how i installed libsvn-java 1.6.

remove any previous version of libsvn-java:
sudo apt-get update
sudo apt-get remove libsvn-java
sudo apt-get autoremove


cd
cd Downloads
wget http://launchpadlibrarian.net/106372496/libapr1_1.4.6-3_amd64.deb
wget http://launchpadlibrarian.net/108089737/libsvn1_1.6.17dfsg-3ubuntu5_amd64.deb
wget http://launchpadlibrarian.net/108089742/libsvn-java_1.6.17dfsg-3ubuntu5_amd64.deb


where i found those packages:
https://launchpad.net/ubuntu/quantal/amd64/libapr1/1.4.6-3
https://launchpad.net/ubuntu/quantal/amd64/libsvn1/1.6.17dfsg-3ubuntu5
https://launchpad.net/ubuntu/quantal/amd64/libsvn-java/1.6.17dfsg-3ubuntu5

install:
sudo dpkg -i libapr1_1.4.6-3_amd64.deb
sudo dpkg -i libsvn1_1.6.17dfsg-3ubuntu5_amd64.deb 
sudo dpkg -i libsvn-java_1.6.17dfsg-3ubuntu5_amd64.deb

also install subversion and subversion-tools for 1.6:

wget http://launchpadlibrarian.net/108089736/subversion_1.6.17dfsg-3ubuntu5_amd64.deb
wget http://launchpadlibrarian.net/108090094/subversion-tools_1.6.17dfsg-3ubuntu5_all.deb

sudo dpkg -i subversion_1.6.17dfsg-3ubuntu5_amd64.deb
sudo dpkg -i subversion-tools_1.6.17dfsg-3ubuntu5_all.deb


where i found those packages:
https://launchpad.net/ubuntu/quantal/amd64/subversion/1.6.17dfsg-3ubuntu5
https://launchpad.net/ubuntu/quantal/amd64/subversion-tools/1.6.17dfsg-3ubuntu5


ubuntu 13.04 clean install problems on Sony Vaio VPCSE - slow startup (long timeout) due to "kvm disabled by BIOS"; slow shutdown due to "speech dispatcher disabled"

installing 13.04 on sony vaio (VPCSE2V9E) has been a terrible experience.


BOOT/SHUTDOWN

* on boot it either hangs a long time or i get a black screen and have to reboot.

* on shutdown it either hangs with the following error message:
acpid: exiting
speech-dispatcher disabled; edit /etc/default/speech-dispatcher


or it takes a long time and i end up having to hold the power key in.

UPDATE 20130604:
to get rid of that speech-dispatcher message i did this:
sudo nano -w /etc/default/speech-dispatcher

and set RUN to yes:
RUN=yes

to get rid of the speech-dispatcher message, disable it:
sudo apt-get install bum

now start BootUp-Manager (sudo bum OR paste "BootUp-Manager" into the Unity Dash search field) and remove the checkmark in the Activate column next to speech dispatcher > Apply > Quit.

(thanks to Nicolas for that one--see his comment on this post)

Note: after deactivating speech-dispatcher, i restarted, logged in, but got just a black screen and a mouse pointer, but couldn't do anything, so i restarted again and then everything was fine.

TESTING: i also disabled acpi in BootUp-Manager to see if this affects the battery problems. (I'm not recommending doing this until I've tested it a little) Before i did this, the laptop was plugged in and the battery indicator in ubuntu said 5 hours to charge until the battery was fully charged. then i disabled this and restarted and it said only 50 minutes left to charge. maybe it helps?

// END UPDATE 20130604


i upgraded to the 3.9 kernel (this user claims it helped with the boot problems) and got the following errors:
dpkg: dependency problems prevent configuration of traverso:
 traverso depends on fftw3.
 traverso depends on libglu1-mesa | libglu1.
 traverso depends on libjack0.100.0-0 (>= 0.102.20).
 traverso depends on libqt4-core (>= 4.2.3).
 traverso depends on libqt4-gui (>= 4.2.3).
 traverso depends on libraptor1 (>= 1.4.11).
 traverso depends on librasqal0 (>= 0.9.13).
 traverso depends on librdf0 (>= 1.0.4).
 traverso depends on libxcursor1 (>> 1.1.2).
 traverso depends on libxinerama1.
 traverso depends on libxrandr2 (>= 2:1.2.0).
 traverso depends on cdrdao.
 traverso depends on sox.

dpkg: error processing traverso (--install):
 dependency problems - leaving unconfigured
Setting up dcp9270cdncupswrapper (1.1.1-5) ...
cups stop/waiting
cups start/running, process 30056
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for hicolor-icon-theme ...
Errors were encountered while processing:
 traverso


to fix the dependency problems:
sudo apt-get -f install


boot and shutdown seem a little more stable after upgrading the kernel.


VIDEO

* i tried enabling the proprietary fglrx video drivers and enabling virtualization in the BIOS (to get into the BIOS at boot you press the F2 key), but forget about that working! unity doesn't work at all with that configuration, there's no unity bar or menus in the windows. so i recommend the default video drivers. FYI, to configure the video drivers go here:

Software > Updates (the bash/cli command for software and updates is update-manager) > Additional Drivers tab

to fix unity after switching back to the default drivers, i ran these commands:
sudo dconf reset -f /org/compiz/
setsid unity

one good thing though is that i'm able to rotate my second screen correctly with the default video drivers, without having to use the proprietary drivers and i haven't noticed my laptop's cooling fan at all (earlier version of ubuntu made my laptop fan run all the time when using the default video drivers)! :)


AUDIO

* audio seems just as buggy as 12.04. i got audio working when i plugged in my headphones yesterday, but today the only output i get is "dummy output", with no sound :(

UPDATE
to fix audio and enable sound do the following:
i had no sound after my install so i had to start alsamixer in a terminal then set Auto-Mute to Disabled

then i restarted pulseaudio and i got sound back:
sudo killall pulseaudio

another crappy thing about 13.04 is that nautilus doesn't have F3 split functionality any more :(

see also: what i configure and install immediately after a new, clean install of ubuntu (updated now for ubuntu 13.04)

20130513

war web application wouldn't deploy after upgrading eclipse plugins: java.lang.reflect.InvocationTargetException

i'm using eclipse juno and just upgraded my plugins. when i tried deploying my jee application i suddenly got the following error in the console:
java.lang.reflect.InvocationTargetException
Servlet mapping specifies an unknown servlet name Faces Servlet

to fix this i had to add a servlet declaration in web.xml:
 <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>


this part of web.xml was already there:
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.faces</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>/faces/*</url-pattern>
 </servlet-mapping>

once i added the servlet declaration, then things started working again. the funny thing is that everything worked fine before.

thanks to these pages:
http://www.javaissues.com/2009/08/servlet-mapping-specifies-unknown.html


http://static.springsource.org/spring-webflow/docs/2.0.x/reference/html/ch12s03.html



[SOLVED] eclipse f3 not working with multiple faces-config.xml

I have the jboss tools jsf plugin installed in eclipse. I have a war module with a faces-config.xml, but eclipse doesn't seem to be able to see my managed-bean(s) there, because when i hit F3 on a managed bean name in JSF, nothing happens. However, F3 works fine for managed beans in another module of the same project, even if i use those beans in the same JSF page inside my war module.

What's weird is I can F3 the class in the faces-config.xml that eclipse doesn't seem to see.

I haven't figured out how to fix this one. Anyone ever experience this? (SEE UPDATES BELOW FOR WORKAROUND SOLUTION)



additional relevant keywords: jsf xhtml eclipse can't open managed bean selection


UPDATE 20130514

when i reconfigured jsf capabilities in eclipse i got up a dialogue box asking if i wanted to configure faces servlet automatically in web.xml and one of the text fields was the path to the faces-config.xml file, so this seems to imply that it isn't possible to have F3 functionality for more than one faces-config.xml :( (SEE UPDATE BELOW FOR WORKAROUND SOLUTION)


UPDATE 20130516
so as a workaround, if you have multiple faces-config.xml files (e.g. FC1, FC2), then you need to copy those managed-bean entries from FC2 to FC1 (FC1 is the faces-config.xml that you specified in your main project's "Project Facets" > "JavaServer Faces" / JSF Capabilities configuration (see above image).

i've submitted this as a bug to eclipse.

How to configure JRebel for a war module

Here's how I configured JRebel for our company's member application war module:

build.xml code:
<war destfile="${dest.ear.dir}/memberapp.war" webxml="${root}/memberapp/WEB-INF/web.xml">
    <classes dir="${root}/memberapp/WEB-INF" includes="rebel.xml"/>
    <classes dir="${dest.dir}/java" includes="com/tc/memberapp/**"/>
    <webinf dir="${root}/memberapp/WEB-INF" excludes="classes/,web.xml,rebel.xml"/>
    <fileset dir="${root}/memberapp" excludes="com/,WEB-INF/"/>
</war>



${root} == /home/me/eclipseWorkspace/trunk
${dest.dir} == /home/me/eclipseWorkspace/trunk/tmp/src (a temporary folder used during the build)
${dest.ear.dir} == /home/me/eclipseWorkspace/trunk/tmp/dist/company-ear (a temporary folder used during the build)


rebel.xml location in our source:
/home/me/eclipseWorkspace/trunk/memberapp/WEB-INF/rebel.xml


as you can see from the build.xml code, during the ant build, rebel.xml gets moved to WEB-INF/classes, so the final location in the company-app.ear looks like this:
<company-app.ear>/memberapp.war/WEB-INF/classes/rebel.xml


rebel.xml contents:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
    <classpath>
        <dir name="/home/me/eclipseWorkspace/trunk/bin/com/tc/memberapp"/>
    </classpath>
    <web>
        <link target="/">
            <dir name="/home/me/eclipseWorkspace/trunk/memberapp" />
        </link>
    </web>
</application>



what is important to notice here is that the link target is root, i.e. / and NOT /MemberApp/ (the actual web deployment location in a browser) because according to the jrebel documentation:
"This will ... map the web resources in the [dir name] directory to the root ("/") of the web application context"


Note: Each war module needs its own rebel.xml.