17 December 2008

SCSNI - Passed

Just went to Prometric website and got the information that I passed the SCSNI, Sun Certified Specialist NetBeans IDE.

Was really tiring exam and I am very relieved that I passed it since I went to Helsinki, there was no exam appointments here in Tampere, and of course it was a beta exam meaning FREE ;).

But anyway I posted my notes and few links I found through the web related to this exam in this blog. Hope that it can help someone that might need.

I am still studying for SCBCD, using NB of course, I hope will be trying next year close to february (as part of my new years resolution).

After this one I'm much in doubt in what to do next. Have been thinking about some IBM certification or Microsoft ones. Database related would be nice to have.

Opinions, suggestions feel free to send me. :)

12 November 2008

SCSNI Exam Testing Objectives

Very useful faq that can be used with many of the sections down here.
Exam Testing Objectives

  • Section 1: IDE Configuration
    • 1.1 Demonstrate the ability to configure the functionality available in the IDE, including using enabling and disabling functionality and using the Plugin Manager.
    • 1.2 Explain the purpose of the user directory and the netbeans.conf file and how these can be used to configure the IDE.
You can pass startup parameters to the IDE launcher using the IDE-HOME/etc/netbeans.conf file. The launcher reads this file prior to parsing the command-line options, including any parameters you have added.
--cp:p additional-classpath prefixes specified classpath to the ides classpath
--cp:a additional-classpath appends specified classpath to the ides classpath
-Jjvm-flags Passes the specified flags directly to the JVM software.
    • 1.3 Demonstrate the ability to work with servers in the IDE, such as registering new server instances and stopping and starting servers.

    • 1.4 Describe how to integrate external libraries in the IDE and use them in coding and debugging your project.

    • 1.5 Demonstrate knowledge of working with databases in the IDE, including registering new database connections and tables running SQL scripts.

    • 1.6 Describe how to integrate and use different versions of the JDK in the IDE for coding, debugging, and viewing Javadoc documentation.

On properties on project node

  • Section 3: Java SE Development

    • 3.1 Demonstrate the ability to create NetBeans projects from the source code of an existing Java SE program.
    • 3.2 Describe how to manage the classpath of a Java SE project, including maintaining a separate classpath for compiling and debugging.
    • 3.3 Demonstrate the knowledge of the NetBeans GUI Builder and the ability to lay out and hook up basic forms using it.
    • 3.4 Demonstrate the ability to package and distribute a built Java Desktop project for use by another user.

  • Section 4: Java EE Web Development

    • 4.1 Describe how to create a NetBeans project from the source code of an existing Web application.

    • 4.2 Distinguish between a visual web application and web application.
    (under Visual Web Application Development) http://www.netbeans.org/kb/trails/web.html

    • 4.3 Demonstrate knowledge of which web frameworks are available in NetBeans IDE and how they are added to and used in a web application.

    • 4.4 Describe how to monitor HTTP requests when running a web application.

    • 4.5 Demonstrate a knowledge of basic tasks related to building and deploying web applications to a server, such as changing the target server and undeploying an application.

  • Section 5: Editing

    • 5.1 Describe the purpose and uses of refactoring and demonstrate the ability to perform basic refactoring on Java source code.

    • 5.2 Describe how to use the Options window to change the default appearance and behavior of the Source Editor.
    Netbeans help under "Using the Options Window"
    The Options window enables you to change any of the IDE's configurable settings. The Options window offers two views for editing IDE settings.
    Basic Options view (default). In the Basic Options view, you select a category at the top of the window to display its settings in the lower pane. Depending on the category, you can click on the tabs in the lower pane to access additional settings. When you change settings in Basic Options, the changes are not applied until you click OK.
    Advanced Options view. In the Advanced Options view, select a node in the tree view in the left pane to display the property sheet in the right pane. The property sheet contains the names and values of the settings for the item selected in the left pane. When you change settings in the property sheet, the changes are applied immediately. The Advanced Options view enables you to access some settings not available in Basic Options. In the Advanced Options view you can apply specific settings globally or at the user level.
    When you open the Options window, the default view is Basic Options. To switch between views, click the Advanced Options or Basic Options buttons in the Options window.
    To edit IDE settings in the Options window:
    Open the Options window by choosing Tools > Options from the main menu. (If you are running on Mac OS X, choose NetBeans > Preferences.)
    If you want to edit settings in Advanced Options, click Advanced Options in the Options window.
    Depending on which view you are in, select the category in the upper pane (Basic) or node in the left pane (Advanced) to display the configurable settings.
    Modify the settings.
    Close the Options window.
    Editing Settings in Advanced Options
    Editing property sheets When you are editing settings in Advanced Options, you can edit the property sheet in the following ways:
    If the setting is a string, you edit the value inline and press Enter to save the change.
    If a drop-down list appears when you select the option's node, click the arrow to select the value.
    If an ellipsis (...) button appears when you select the option node, click the button to open the property's editor.
    In Advanced Options, changes are applied immediately.
    Levels of settings When you are in Advanced Options, you can store settings at two levels:
    Default. Initial settings provided with the IDE installation. The IDE's default settings cannot be altered, however, they can be overriden by defining them at the User level.
    User. Settings defined at the User level that override settings at the Default level.
    By default the columns for User and Default are hidden. To display the User and Default columns, click << in the column heading. To hide the columns, click >>.
    The following table defines the icons used in Advanced Options to indicate the levels at which settings are applied.

    The settings for the corresponding options are defined at the level indicated in the column's title. Any changes made to those settings apply at that level.

    The settings for the corresponding options are inherited from a higher level.

    The settings for the corresponding options are ignored at the indicated level.
    To define an option's value at the User level:
    Select the node for the option you want to configure.
    Click the cell in the User column for the options node you selected and choose Define Here.
    The icon appears in the User column.
    In the property sheet, configure the desired settings.
    The new values for the selected options override the default values.
    To revert to the default settings for an option:
    Select the node for the option you want to configure.
    Click the cell in the Default column for the options node you selected and Choose Revert Definition.
    In the the dialog box, click Yes if you are sure you want to remove the selected option's User-level configuration.
    The default values for the selected options are restored. The icon appears in the Default column and the icon appears in the User column.
    When reverting to default settings, the IDE removes any values stored at the User level for the selected option.

    • 5.3 Describe the ways that the IDE highlights errors in source code and the tools the IDE offers for correcting those errors.
    • 6.2 Describe how to debug a local (desktop) application, including setting breakpoints and stepping through code.

11 November 2008

Sun Certified Specialist NetBeans IDE

The SCSNI is a certification exam for the NetBeans IDE.
The topics range from profiling, VCS, debugging, creationg of desktop/web applications and others...

Its a really nice exam, even though the beta exam was very extensive and tiring to say at least.

I have collected few links as a study guide and also created a document, google docs, with the topics and links for tutorials on each subject. I prefer tutorials than the help pages since its kinda boring to be reading just the topics on the help.

Another thing is that experience with the IDE is required. I dont think that just few reading, like with every certification exam, would make you pass... And since there are no books yet to this exam the best place to find sources is the NetBeans page.

Here are the links:
In my opinion, the combination of these 2 links and the one that I created will work pretty well...
Any questions or suggestions feel free to contact me...

Good luck with the studies.

08 April 2008

Studying for certification ? Netbeans is the answer...

For me this is the best IDE so far to help me in my studies in Java Certification.
It helped me a lot with SCJP and SCWCD and still helps me a lot with the SCBCD.

Why ? Because I just download one package of the IDE, install and start coding the examples in the book and studying them...

With some other IDE you need to configure a heck lot of stuff... It drives you away from the fact that you NEED to study the technology and not be configuring it to suit your best needs. Let's face it... If you are studying already a certification is because you have little knowledge about a specific subject and you want to make it better.

07 April 2008

X-Fi on Ubuntu 7.10

"[Alsa-user] Sound Card SB X-Fi Extreme Audio finally working

mario dupuis
Sun, 13 Jan 2008 11:15:14 -0800

For those who may have encountered problems with no sound coming from this card
under ubuntu Gutsy-Gibbon 7.10 (kernel 2.6.22-14-generic), here's the solution
that worked for me (could work with other distros as well, but i can't test them

Download the latest version here:

After that, do the following in a terminal:
to make sure all will operate correctly, do the following, before any install
$ sudo apt-get install build-essential
and after that you do that:

$ cd
$$ tar xvzf alsa-driver-1.0.15.tar.bz2
$$ cd alsa-driver-1.0.15
$$ sudo ./configure
$$ make
$$ sudo make install

reboot, and it should work

Another thing, you must deactivate in the volume panel EC958, if it is
activated, and use only analog settings (front/center/side/rear, depending on
your speaker setup, chose only analog front for 2.0 speaker system). You may
have to go into edit-->preferences (into the volume panel) to have the volume
sliders enabled for analog. You may use (although not tested) the digital
settings, if you connect your card to a digital sound system through the digital
output of your soundcard.

That's the way it worked for me. So don't throw your soundcard over the window,
there is a possible solution.

Sadly the sound isn't that awesome as you expect it to be...
The problem is exactly with creative who should let it go of this struggle to keep the drivers from being open sourced... I also have logitech z-10 speakers which make it even more confusing for the system...

NetBeans6.1+EJB3+Struts [PART 4]

You will have something like this (note that the code is folded)

Now Right click the BookCRUDAction and select Enterprise Resources->Call Enterprise Bean.

Click on MyApp-ejb, select BookFacade and click OK.

The following method will be implemented for you:

private BookFacadeLocal lookupBookFacade()

This way you will be able to access your bean from MyApp-war.

Now, open struts-config.xml from Configuration Files directory and insert these lines:

*(somehow i couldnt post these lines in blogger, dunno why...)*

These lines will tie the methods from the Action to struts-config mappings.

NetBeans6.1+EJB3+Struts [PART 3]

Now right click on MyApp-war, choose Properties->Frameworks->Add->Struts and press Ok and then Ok one more time.

If you right click MyApp-war, choose Properties and click on Frameworks you are going to notice that Struts Framework was added to the list of Used Frameworks.

Now in MyApp-war, Right Click->New->Other... and choose Struts in the Categories list.
And in
File Types list choose Struts Action.

Click Next > and enter the following information:
Class Name: BookForm
package: action

Click Finish and the FormBean will be created and the information will be written in the struts-config.xml

One more time in MyApp-war, Right Click->New->Other... and choose Struts in the Categories list.
And in
File Types list choose Struts Action.

Click Next > and enter the following information:

Class Name: BookCRUDAction
Package: action
Superclass: select in the dropdown MappingDispatchAction
Action Path
: /book.do
Next >

In the second part of the Action Wizard type the following information:

Scope: Request
ActionFormBean Name: BookForm
Parameter: create

And hit the Finish button.

The BookCRUDAction is then opened in your editor window. The mapping for the newly created Action is also added in struts-config.xml.

Now change the signature of the method from:

public ActionForward customMethod(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception


public ActionForward create(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception

This is done to be aligned with the information that was typed in the Parameter box while creating the Action class.

Copy and paste the entire method THREE more times so you will have the read, update and delete methods.

02 April 2008

NetBeans6.1+EJB3+Struts [PART 2]

Click Next and in packages you type entities and hit the Finish button.

This will generate the Java POJO's for you directly from the Database with all of the Annotations required.

Now navigate to Source Packages and open your Java Class. Take a look at how much code the IDE has already created. Also methods like hashCode, equals and even a @NameQueries annotation was added.

Now add @GeneratedValue(strategy = GenerationType.AUTO) to the top of your id field.

After adding the Annotation your code will look like this:

@Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;

This will tell the Entity Manager to take care of the ID sequence.

Right click again on MyApp-ejb, New->Other->Persistence->Session Beans for Entity Classes.
Click on Next
select the entity class available
click Add >
And click Finish.

This will create the the Session Bean interface and the implementation.
Two classes will open in your editor.
Click on the Facade one and check it out all of the methods that the IDE generated one more time for you. You have a CRUD just with few clicks. ;)

Creating all of those classes through the IDE diminishes the eventuality of error-prone code of the many, many Session Beans you might be creating by hand. And also removes the tedious/slow work of editing xml's and the necessity of redundant code writing. ;)

NetBeans6.1+EJB3+Struts [PART 1]

Hi all, I just decided to start a blog and with the new blog comes already a review about the new NetBeans 6.1, still in beta phase but incredibly stable and FAST.

In this tutorial we will use NetBeans 6.1 Web & Java EE version.
This is the list of software one might need:

  • JDK 1.5
  • GlassFish V2 UR1
  • some database (I will use for this tutorial java db but mysql is also a good option)

NetBeans 6.1 Web & Java EE comes already bundled with GlassFish and Tomcat. In just 105 mb!!!. It's awesome to download just one package and a small one.

With NB6.1 you will see how fast it can be to configure/create/code with it.
I will assume that you have already a table in one database of your preference.

After downloading, installing and running NetBeans you will need to create a new project.

Click in File->New Project...choose Enterprise and then Enterprise Application.

Inside the Enterprise Application NetBeans will automatically create for you an EJB Module and Web Application Module.

Type MyApp in the Project Name and leave all of the other settings as it is.

Click in Next and Finish.

Notice that in on the left side in the Projects tab 3 modules were added: MyApp, MyApp-ejb and MyApp-war.

Right click on MyApp-ejb and select New->Other->Persistence->Persistence Unit.

Click in the dropdown box in Data Source and select your DB connection. Then in Table Generation Strategy select create. And leave Use Java Transaction APIs selected.

Once Finish is clicked a persistence.xml tab will open.

The persistence unit will tell your container how the entities will be persisted and managed in the application.

Now right click again in MyApp-ejb and select New->Entity Classes from Database.

In Data Source select the JNDI name that you have configured and the tables will appear in the right side of the panel, select the table you want to create the Java Classes and click in Add>

30 March 2008

Can't publish web app to GlassFish


The easy fix for this is to add your Dynamic Web Project to an EAR project -
EDIT: you could also just update your eclipse, I just did this, and the patch is included in the WTP updates, after I found the solution with adding it to an EAR project, I installed the updates, and verified that it works with publishing a WAR file as well.

For me that works like a charm, I'm running eclipse 3.3.2 (j2ee distribution) and GlassFish v2ur1 and the GlassFish eclipse plugin on Ubuntu Linux 7.10. (eclipse and glassfish are totally fresh installs)

If you already have a Dynamic Web Projecct, then create a new EAR project (right click in project explorer and select "new -> project..." and under j2ee select "Enterprise Application Project" name it, and follow the wizard, then selecting your Dynamic Web Project.

Then under your server view, right click on your server and select "add and remove projects..." and add your EAR project."

I also found out that by removing the white spaces in between your workspace would solve the problem. I had a similar problem with Glassfish but in NetBeans. Maybe not a problem of eclipse/netbeans at all...(?!)