Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Java EE 7 Is About To Coming?

Java EE 7 AKA The Cloud some feature: multi-tenancy, application versioning, support for NRDBMS stores but also about modularity, trying to leverage what will be done at the JavaSE level. Of all the APIs up for a new version, JAX-RS and JPA seem to be the closest to being filed as JSRs.


It's been one year since Java EE 6 was released (December 2009) and it's now time to start talking about Java EE 7. In fact at JavaOne San Francisco in September, at Devoxx in November and at JavaOne Sao Paulo and Beijing in December, the technical keynotes have gradually introduced what Oracle would like to see addressed in this release.


Credit: Oracle newsletter

ADF Bugs

I'm not sure if this ADF or JSF or Java VM bugs, but i'm having this bugs while using JDeveloper 10g and ADF Toplink technology. So i assume this is ADF bugs.


How to produce this bugs ?
1. Open JDeveloper IDE
2. Create new JSF page
3. Add a lot of component ex 1000 command button just like this

ADF Bugs

4. Run


The console will throw error like this :
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d741046, pid=3156, tid=1616
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# V  [jvm.dll+0x61046]
#
# An error report file with more information is saved as hs_err_pid3156.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Process exited with exit code 1.

ADF How To Clear or Reset Search Form in Jdev10g

Google Blogger does not allow me to upload attachment so wait for 4 images loaded.

Credits :

Olaf Heimburger
Frank Nimphius
OTN Forum


The problem :
Let say my application based on HR schema. I've search form for employees and departments.
For employee we can search by first name, last name, email and so on.
For departments we can search by department name and manager.

So i enter employee search form and search employee first name Steven. I got 2 records, thats fine.
I leave to another form and now the riddiculous thing are when you come back to employee search form again,
you'll see your previous first name parameter Steven and your previous result which is 2 records.

Thats mean to me Oracle does not clear / reset input value in the form.

Toplink Jdev10g How To Delete Child Record

The problem :
Recently i've found problem when trying to delete the record with child record programmaticly using Toplink in Jdev10g.

For example imagine i'm about to delete IT Department in HR schema.

Here is my piece of code in SessionBean to do that :

uow.deleteObject(itDept);

And my embedded OC4J thrown me
Exception TOPLINK-4002 (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061214)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.BatchUpdateException: error occurred during batching: ORA-02292: integrity constraint (FK_CHILD_PARENT) violated - child record found

MyEclipse IDE 7 Free License

MyEclipse 7 Released, Get The Free License Now

Genuitec offering free license to people comment in TheServerSide thread. Here is the thread
http://www.theserverside.com/news/thread.tss?thread_id=52237

Give your good comment and pray for the free license.


Some new feature in MyEclipse 7.
# Advanced JavaScript tooling

# New Plugin Dashboard

# REST Web Services wizards and explorer

# MyEclipse Spring tools

# OpenJPA support for MyEclipse Persistence tools

# MyEclipse Reports upgrade

# UML1, UML2 upgrades

# New JSF views and enhancements

# MyEclipse ICEfaces tooling update

Oracle ADF Faces Template in JDev 10g

My project (maybe almost project need this) require a template so when developing user interface, developer no need repeat adding banner, logo, application title, footer, etc. SRDemo example teach me to create template.jspx file and then copy paste this template to another jspx file. This is bad idea, because if somehow my logo changed, then i need to modified ALL of my jspx file.


So i'm start Googling to research about this. But sadly Oracle does not officially support ADF template in JDev 10g. JDev 11g does, but after some consideration we,re using JDev 10g.


After a bit research led me to ADF Region. But like i said, this is not supported so it's not covered in Oracle ADF Developer Guide book. Thanks to Edwin Biemond blog and AMIS blog to contribute great article about ADF Region.

Oracle JDeveloper 10g Review

After 2 weeks using Oracle JDeveloper 10g, more spesific JDev 10.1.3.3, i'll share my opinion about this tools.


Here is JDev editor in my computer.
JDev 10.1.3.3 Editor

WEB4J Java Web Application Framework

WEB4j
Another simple web framework. According to official website the primary design goal of WEB4J is to always exercise deep compassion for you, the application programmer, to make your tasks as simple, natural, and as effective as possible. The framework should take on as much pain as possible, so that, in the end, you experience as little pain as possible.

Netbeans 6.1 Has Been Released

NetBeans is proud to announce the availability of NetBeans IDE 6.1 for download!

Netbeans 6.1


NetBeans IDE 6.1 supports a wide range of open source scripting technologies and offers improved performance. This release extends language support beyond Java technology by providing a rich set of features for C/C++, JavaScript and the Ruby language, including Ruby on Rails.

One of the downloads available is an Early Access preview of support for PHP. Advance versions of new modules, such as JavaScript debugger, support of ClearCase, AXIS, and Hibernate are available as separate plugins.


NetBeans IDE 6.1 also contains all of the improvements made in 6.0 including: the new smarter editor, next generation of the ground-breaking GUI builder (formerly known as Project Matisse), visual mobile designer, integrated profiler, and Java EE 5 support.

Mural, Open Master Data Management from Sun Microsystems

The Mural community is an open-source community with the purpose of developing an ecosystem of products that solve the problems in Data Management through a collaborative community-driven approach. Leveraging the OpenESB and Netbeans communities, the Mural community seeks to build a foundational open-source data management infrastructure to form the basis of Master Data Management initiatives (i.e., CDI, PIM) and of traditional datawarehousing and business intelligence initiatives. It will also provide data services for SOA initiatives and Enterprise Web 2.0.


Mural Achitecture
mural


The Mural community includes the following set of core components:

  1. Master Index Studio – Provides the capability to create any domain specific master index through the matching, de-duplication, merging, and cleansing of data from various data sources.
  2. Data Integrator – Provides extract, transform, load capability and supports a wide variety of data sources, including relational as well as flat files, spreadsheets, XML, and newer sources such as HTML tables and RSS Feeds. It is also exposed as a Service Engine in OpenESB.
  3. Data Quality - Features matching, standardization, profiling,and cleansing capabilities.
  4. Data Mashup – Provides server-side data mashup capability, having multiple forms, such as exposing data services for enterprise mashups and providing real-time views of information for master data consumers.
  5. Data Migrator – Provides the ability to migrate database objects across database instances.


Source : https://mural.dev.java.net/

The Real Story Why Microsoft Needs Yahoo

So one day, Scott McNealy, founder and chairman of Sun, read in his morning newspaper how the use of Java was rapidly diminishing, courtesy of something called 'The LAMP Stack'. Furiously, he called his accountant.

Scott: "I knew this Java thing was a bad idea in the first place! I see only one solution. We need to buy this Lamp!"
Accountant: "Euh, LAMP is not a company. It's an acronym. It's Linux , Apache, MySQL and PHP"
Scott: "Then buy me Linux!"
Accountant: "But we still have this Solaris thing.."
Scott: "Then buy me Apache!"
Accountant: "That's a foundation. Nothing to buy there."
Scott: "Then buy me MySQL!"
Accountant: "We don't do databases."
Scott: "It's a database?"
Accountant: "What rock have you been living under?"
Scott: "Sweet. I can own the Lamp AND piss off Oracle at the same time!" (waves fake plastic magic wand) "Make it so!"


And so it happened.

Ten days later, Microsoft CEO Steve Ballmer was reading the CIO Magazine, and read about this interesting thing called PHP, that according to the author you could use to write "WHAT?!". "WHAT?!", obviously a highly advanced and evolved version of "Hello World", caught his attention. So he called Bill Gates.

Steve: "Hey, you heard about this PHP thing?"
Bill: "Pee Age Pee? You're not that old yet, are you?"
Steve: "What? No, wait, it's a programming language, apparently better than ASP.NET."
Bill: "Who cares if it's better. I mean; we made the worst operating systems ever and still rule. (Checked out Leopard yet? It is SO cool.)"
Steve: "I don't know Bill... remember that internet thing that we didn't know about years ago? Kind of nearly missed the boat there."
Bill: "Right. Didn't we solve that in the same way? Worst browser, highest market share, that sort of thing?"
Steve: "Yes we did, but then we also didn't know about this 'mp3' thing until it was too late."
Bill: "We did manage to make Zune the worst player, but somehow we're not market leader. Guess we got sloppy?"
Steve: "Maybe it's just different times. Maybe we should have a different strategy."
Bill: "Ok, so let's just buy PHP then."
Steve: "It's not a company. But Encarta says it's written by a Rasmus Lerdorf."
Bill: "So let's hire him."
Steve: "Tried that. Didn't want to join. Can't blame him, works at Yahoo."
Bill: "Then I guess we'll have to buy Yahoo."


So it happened.

Two of the most controversial announcements of this month, and both appear to be part of devious plots to take over the LAMP stack. What's next? My prediction: Red-Hat buys Zend; Oracle buys Red-Hat; Sun and IBM join forces to buy Oracle, Microsoft buys Sun, kills IBM and peace is restored in the galaxy.

P.S. Can you imagine Microsoft running sites like Flickr? These guys invented MS Paint!

Reference http://www.jansch.nl/2008/02/02/microsoft-and-sun-the-real-story/

Sun Microsystem buy MySQL

Sun Microsystems has agreed to buy MySQL AB for $1B, giving them additional leverage in the open source community and providing access to MySQL to its larger corporations. The deal is expected to close during the third or fourth quarter.

The grand question, of course, is: what does this mean in the long term? Sun already offers JavaDB as a smaller-scale DB (compared to 'large offerings' like Oracle9 and IMS). Is Sun merely diversifying its own portfolio, looking for an additional revenue stream from MySQL AB's customers, or shifting away from JavaDB/Derby? Consider the following quote from Sun's press release:

Netbeans 6 Has Been Released

Netbeans 6

Netbeans 6 has been released a few day ago.

The highlight feature of Netbeans 6 are :
*. Enhanced Editor
*. Easy-To-Use Java GUI Builder
*. Visual Mobile Development
*. Ruby and Rails Support
*. Visual Web and Java EE Development
*. Visual UML Modeling
*. C and C++ Development

Download free Netbeans 6.0
http://download.netbeans.org/netbeans/6.0/final/

To order free DVD
http://www.netbeans.org/about/media.html

I already order free DVD shipment into my office.

I can't wait to see the new Netbeans. The most feature i want to try is Ruby and Rails support and Visual Web for Web development.

JBoss Seam 2.0 Has Been Releasead

JBoss Seam is a powerful new application framework for building next generation Web 2.0 applications by unifying and integrating technologies such as Asynchronous JavaScript and XML (AJAX), Java Server Faces (JSF), Enterprise Java Beans (EJB3), Java Portlets and Business Process Management (BPM).

Some Seam 2.0 new feature is :
* The Seam component model now supports web services, including direct support for conversational web services
* Seam components can now be written in Groovy
* New improved EL syntax
* Integration with Quartz, Hibernate Search and JFreeChart
* Support for JSF 1.2, as well as support for non-JSF environments like GWT
* Eclipse IDE support in the next release of JBossTools, including Seam project wizards, EL code completion, a visual JSF editor, hot deployment and test integration

Java Framework Conference

Funny Java Framework conversation. What do u think ?

Starts out with Wicket, Stripes and RIFE making some sensible comments..

Then, Struts1, the grandfather in the rocking chair in the back, interrupts them: "Bah! I was out there making thousands of sites work while you were all in diapers!"

"Yeah, yeah.."

Moderator to three strangely alike-looking guys scattered across the room, wearing shirts with numbers 3, 4 and 5 on them: "and you guys?"

Tap3: I put all you fools on the map!

Tap4 (to Tap3): who are you?

Tap5 (to Tap4): who are you?

Moderator: you mean you guys aren't related? You don't even know each other?

Taps (stroking their beards): Nope..

Struts1: look, here comes my grandson!

(A "horse" comes in, you know those horse costumes with two guys under it..)

Moderator: Hi, Struts2, is that you under there?

Struts2 (person at the head of the horse): yes..

Moderator: who's that behind you?

(Voice at the horse's butt): WebWork!

Then this loud noise as a bunch of security trucks surrounding a limo arrive.

Struts1: there's my other grandson, late, as usual..

(JSF comes in)

JSF: (speaks garbled)

All: what?

JSF (frowning, pressing a button): (h:outputtext value="sorry, I keep forgetting I have to do this everytime I want to say something.. well sorry I'm late, but I wanted to tell you all that I'll be the new STANDARD around here..")

All (looking at each other): who is this guy?

Facelets comes running in frantically.

Facelets: JSF! How many times do I have to tell you never to speak to the media directly? As your publicist, I do all the talking!

JSF (hanging his head): (f:verbatim)Sorry..(/f:verbatim)

Wicket: Hey JSF, race you to write a custom component! GO!

Facelets: hold on now.. (dials cell phone).. let me call Seam and see what we can do.. find a vendor..

Wicket: FINISHED! I win!

RIFE: (starts to say something)

(somebody interrupts)

Moderator: quiet, RIFE was talking, let him finish!

RIFE: No problem, I can easily continue what I was saying.. (finishes what he was saying, using a different template syntax, er, a different accent..)

Stripes: hey JSF, you don't still use your grandfather's XML config file, do you?

JSF: (h:outputtext value="uh..")

Stripes: (shakes his head)

Spring MVC: everyone's welcome to my house, it's pretty cool, not only do I have a web framework for you, but all kinds of other good stuff too.. swimming pool.. tennis court.. bowling alley.. big screen HDTV.. pool table.. open house! come on over!

Moderator: hey, you guys sitting there quietly, you want to stand up and say your names?

"Click!"

"Aranea!"

"Waffle!"

Australian guys: BWAHAHAHAA! His name is Waffle!

Waffle: alright, alright, enough with that already..

"Naked Objects!"

Moderator: hey, none of that in here..

Then, somebody is knocking at the door, trying to get in. It's Rails. But it's a Java web framework conference.. so security won't let him in..

Moderator: anybody can vouch for this guy? should we let him in?

All: nope..

Moderator: anyone even know him?

Grails: nope..
Trails: nope..
Sails: nope..
Pails: nope..
Quails: nope..
Jails: nope..

Moderator: sheesh..

IntelliJ IDEA 7.0 Released

IntelliJ IDEA 7.0

Jetbrains has announced the release of IntelliJ IDEA 7.0

Being traditionally focused at developers’ productivity, IntelliJ IDEA continues adding numerous productivity-boosting features and enhancements to make everyday development a real pleasure:

* Spring and Hibernate support
* Web and enterprise development
* Performance improvement
* Eclipse and Maven integration
* VCS integration
* Dynamic language
* Debugger
* Project configuration
* Refactoring

Full feature can be found here

IntelliJ IDEA 7.0

IntelliJ IDEA is commercial Java IDE, but you can try for 30 days.

Square Root More Than 2 in Java

I know its sound simple, but in fact i spent more than 20 minute in Google to find the answer.

By default Java only provide method square root by 2 like this :
double root = Math.sqrt(new Double("4")); // 4 square root by 2, result is 2

If you want square root more than 2, use this :
double root = Math.pow(new Double("8"), new Double("0.3333333")); // 8 square root by 3, result is 2

Why The Most Popular Sites Not Using Java

An interesting article and discussion in www.highscalability.com about why the mostly popular sites like ebay, flickr, myspace, yousendit, meebo, amazon, friendster does not use pure Java.



I think because J2EE is too complex and not of J2EE component is the most efective for some condition, for example ebay uses Java, but not all component Ebay just uses servlets and JDK. They don't use JSP, EJB, JMS and the other. I mean if PHP can do better why we choose JSP ?

www.theserverside.com said the two reason are :
1. LAMP (Linux, Apache, MySQL, PHP) is open source and cost effective
2. J2EE is used, but only as part of the application stack, not as the entire stack itself.

Intoducing Yahoo User Interface (YUI) Library

Yahoo has announced Yahoo User Interface (YUI) library for developer.

The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. The YUI Library also includes several core CSS resources. All components in the YUI Library have been released as open source under a BSD license and are free for all uses.

Yahoo User Interface

Download YUI at http://developer.yahoo.com/yui/

How Adsense Scripts Works

Do you wonder how Google Adsense scripts work. I mean this is just script, how can shows up relevant ads to our website.

I'll try to explain the secret of Google Adsense Scripts, show_ads.js

Before we continue, it's important to you understand this article for education only, not for hacking Google Adsense Scripts. You break ToS GA if you do that. We are on the same page now ? Ok good.

Google Adsense Script (show_ads.js) maybe protected by Obfuscator to make the script hard to read. I need a lot of time to reformat script and rename variabel based on my logic.

How Google Adsense Scripts work ?


(script type="text/javascript")(!--
google_ad_client = "pub-71209491204xxxxx";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_cpa_choice = "CAEQyvTH1QMaCLmcVsXlpQobKILJ0s0BMAA";
//--)
(/script)
(script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript")
(/script)

Notes : I've changed <> to () to prevent ads shows up in this post.


Look at script beginning with "google_" thats is parameter sent to show_ads.js to build a large query string to server, and server returning back by showing ads. By default you can't modify script unless you are premium publisher like slasdot.org.
There is no different script between premium publisher and normal publisher, we using the same script, show_ads.js. The different is normal publisher DISALLOWED to use all parameter in show_ads.js

The complete parameter of Adsense script, show_ads.js













































































































































































Parameter Description
google_ad_client Your Adsense publisher id
google_ad_output By default is "html". Other value is "js" or "textlink"
google_ad_host 3rd party host. Sharing your revenue with them. For example if you publish your adsense code using blogger service by adding widget then you will sharing revenue with blogger.com
google_ad_channel Channel, for tracking performance your ads
google_ad_region I don't know yet. Somebody tell me
google_ad_section Focusing Google crawl or bot to showing ads inside tag google_ad_section_start and google_ad_section_end
google_ad_type Format of your ads, it can be "text", "image" or "text_image"
google_ad_override I don't know yet. Somebody tell me
google_alternate_ad_url Alternate url if PSA (Public Service Ads) shows up
google_alternate_color Fill with color if PSA (Public Service Ads) shows up
google_cpa_choice The referral id you choose
google_ad_override I don't know yet. Somebody tell me
google_country Country
google_city City
google_safe slashdot.org using it. But i don't know yet
google_country Country
google_hints I don't know yet. Somebody tell me
google_encoding Probably encode referral id ads
google_last_modified_time I don't know yet. Somebody tell me
google_targeting I don't know yet. Somebody tell me
google_max_num_ads Sets maximum ads. I've seen some site can shows 10 content ads. But this is against Adsense ToS
google_page_url Our website url maybe ?
google_color_bg Background color
google_color_text Teks color
google_color_link Link color
google_color_url Url color
google_color_border Border color
google_color_line Line color
google_kw_type I don't know yet. Somebody tell me
google_targeting I don't know yet. Somebody tell me
google_language Someone said, if your website not using english then set "google_language = en", to prevent PSA shows up, but of course this against Adsense ToS
google_feedback Feedback link
google_page_location Maybe location where ads shows up
google_cust_age Your profile
google_gender Your profile
google_cust_interests Your profile
google_cust_idid Your profile
google_cust_job Your profile
google_cust_u_url Your profile
google_cust_lh Your profile
google_cust_ch Your profile
google_ed I don't know yet. Somebody tell me


I can't explain all parameter, it will help me if someone share to me.

PS : I don't know why blank space appears before table. Probably Blogger bugs