How to create Immutable Class in Java

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , with Leave a comment on How to create Immutable Class in Java

creating the Immutable class in Java with simple source code example

We have heard the word “Immutable class” lots of time in Java. The best example is class “String“. Immutable class is the class whose value cannot be changed throughout the life cycle. We cannot change the content of String class, everytime new reference is created when we change the content, that is the basic difference between String and StringBuffer Class.
In this article, i will explain the step by step process to create the custom Immutable class in Java.
Our class should not able to derived and for that we will declare our class as final. The values cannot be change and thats why we will declare all the variables as final and we will provide only the getter methods as we cannot write setters because of final variables.
So to summarize, following steps needs to be taken: Continue reading “How to create Immutable Class in Java”

Create SOAP message using Java

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , , with 1 Comment on Create SOAP message using Java

Step by Step Example of creating SOAP Message using core Java API

In this article, i am going to create the SOAP Message by using core Java Only. SOAP Stands for ” Simple Object Access Protocol”, which is used to exchange the structured information via Webservices.

SOAP Message consist of following three parts:

  1. SOAP-ENV:Envelope
  2. SOAP-ENV:Header
  3. SOAP-ENV:Body
SOAP Message Format for Web Services
SOAP Message Format for Web Services

Continue reading “Create SOAP message using Java”

Quartz framework tutorial with example – Schedule job in Java

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , with 8 Comments on Quartz framework tutorial with example – Schedule job in Java

Tutorial of the Quartz framework for Java. Schedule job without loosing the performance of the application

What is Quartz?

Quartz is a job scheduling system that can be integrated with, or used along side virtually any other software system. The term “job scheduler” seems to conjure different ideas for different people. As you read this tutorial, you should be able to get a firm idea of what we mean when we use this term, but in short, a job scheduler is a system that is responsible for executing (or notifying) other software components when a pre-determined (scheduled) time arrives.
Quartz is quite flexible, and contains multiple usage paradigms that can be used separately or together, in order to achieve your desired behavior, and enable you to write your code in the manner that seems most ‘natural’ to your project.
Quartz is very light-weight, and requires very little setup/configuration – it can actually be used ‘out-of-the-box’ if your needs are relatively basic.
Quartz is fault-tolerant, and can persist (‘remember’) your scheduled jobs between system restarts.
Although Quartz is extremely useful for simply running certain system processes on given schedules, the full potential of Quartz can be realized when you learn how to use it to drive the flow of your application’s business processes.

Why not just use java.util.Timer?
Since JDK 1.3, Java has “built-in” timer capabilities, through the java.util.Timer and java.util.TimerTask classes – why would someone use Quartz rather than these standard features?
There are many reasons! Here are a few:

  1. Timers have no persistence mechanism.
  2. Timers have inflexible scheduling (only able to set start-time & repeat interval, nothing based on dates, time of day, etc.)
  3. Timers don’t utilize a thread-pool (one thread per timer)
  4. Timers have no real management schemes – you’d have to write your own mechanism for being able to remember, organize and retrieve your tasks by name, etc.

Continue reading “Quartz framework tutorial with example – Schedule job in Java”

Step By Step Hibernate Tutorial Using eclipse WTP

Author posted by Jitendra on Posted on under category Categories Hibernate, My SQL and tagged as Tags , with 31 Comments on Step By Step Hibernate Tutorial Using eclipse WTP

Step By Step Hibernate (ORM Tool) Tutorial Using eclipse WTP

Hibernate is the ORM tool widely used in java community to persist the java object using Object Relational Mapping (ORM) concept. ORM reduces number of lines to interact with database with optimized query language which is Hibernate Query language (HQL).

In this example, we will create a simple login application using hibernate tool of eclipse. We will use eclipse WTP (Web Tools Platform), to install “Hibernate Tools”. Follow below steps :

In Eclipse IDE, menu bar, select “Help” >> “Install New Software …” put the Eclipse update site URL “http://download.jboss.org/jbosstools/updates/stable/helios”

Eclipse Install New Software - Hibernate
Eclipse Install New Software - Hibernate

Continue reading “Step By Step Hibernate Tutorial Using eclipse WTP”

How to start the tomcat in debug mode for debugging in eclipse

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags , with 2 Comments on How to start the tomcat in debug mode for debugging in eclipse

This is the tutorial on How to start the tomcat in debug mode for debugging in eclipse

1. Open the startup script in (your_tomcat_home) {Location is : %CATALINA_HOME%binstartup.bat }
2. Add the following lines at the first blank line in the file ( around line 8 )
Windows :

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket

Linux:

export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket

3. Change the execute line at the end to include “jpda”
Window:

call “%EXECUTABLE%” jpda start %CMD_LINE_ARGS%

Linux:

exec “$PRGDIR”/”$EXECUTABLE” jpda start “$@”

CC&B error Resolve – Unable to move value into property

Author posted by Jitendra on Posted on under category Categories JAVA and tagged as Tags with Leave a comment on CC&B error Resolve – Unable to move value into property

How to resolve the error “Unable to move value into property” in Customer care and Billing (CC&B) / Oracle revenue management and billing System (ORMB) / Oracle Utilities

Hi Friends this is very small but useful post to resolve the error “Unable to move value into”. Following is the snap of exception i found during developement (While inserting the value into Business Object [BO] using Business Service [BS] ).

The root LoggedException was: Unable to move value: ‘123456’ into property: ‘PolicyNum’
at com.splwg.shared.common.LoggedException.wrap(LoggedException.java:198)
..
..
..
Caused by: java.lang.NoSuchMethodException: Unknown property  : PolicyNum for bean class ‘com.splwg.cm.domain.customerinfo.policy.CmFeePolicy_DTO’
at com.splwg.shared.common.PropertyUtils.getMethodDescriptor(PropertyUtils.java:121)

Continue reading “CC&B error Resolve – Unable to move value into property”

Create BPA Script in Oracle Utilities to invoke UI Map

Author posted by Jitendra on Posted on under category Categories JAVA, Oracle and tagged as Tags with 3 Comments on Create BPA Script in Oracle Utilities to invoke UI Map

This is the fourth article in series And we will see how to Create BPA Script in Oracle Utilities to invoke UI Map.

In this post, i will discuss on creating the BPA Script to invoke the UI Map.

Navigate to “Admin Menu | S | Script +” and the details as per below image:

 

Creating BPA Script in Oracle Utilities / ORMB / CC&B
Creating BPA Script in Oracle Utilities

Continue reading “Create BPA Script in Oracle Utilities to invoke UI Map”

Creating UI Map in Oracle Utilities

Author posted by Jitendra on Posted on under category Categories JAVA, Oracle and tagged as Tags with Leave a comment on Creating UI Map in Oracle Utilities

This is the third article in series for creating the UI Map in Oracle Utlities / CC&B / ORMB

This is the third article in series to create the UI Map in Oracle Utilities. In Previous two article we have seen that how to create the Business Service, Data Area and Service Program.

Navigate to “Admin Menu | U | UI Map +“. Give the UI Map Name as “CM_PERINPUT” and select “UI Map Type” = Complete HTML Document.

Creating UI Map in Oracle Utilities / CC&B / ORMB
Creating UI Map in Oracle Utilities

Continue reading “Creating UI Map in Oracle Utilities”

Creating Business Service and Service Program in ORMB / CC&B / Oracle Utilities

Creating Business Service and Service Programin ORMB / CC&B / Oracle Utilities

In Previous article, we have seen that how to create the Data Area and benefits of using Data Area. This article will focus on creating the Business Service and Service Program in CC&B.

First we have to create the Business Service in application then we have to code it in JAVA and deploy the updated “cm.jar“ file on server.

Go to “Admin | S | Service Program +“ and enter the Service name, Description and select the “Java Based Service” as Service Type.  In this example my service name is “PERSER“.

Now go to “Admin | B | Business Service +“ and enter the Business Service name and select the previously create service “PERSER“ for Service Name using look up. In this case the Business Service Name is “CM_PERSER“.
Now go to the “Schema” and add following code and click on Save. Continue reading “Creating Business Service and Service Program in ORMB / CC&B / Oracle Utilities”

Step by Step tutorial for creation of Business Service, Data Area, UI Map and BPA Script in ORMB / CC&B / Oracle Utilities for beginners

Step by Step tutorial for creation guide of Business Service, Data Area, UI Map and BPA Script in ORMB / CC&B / Oracle Utilities for beginners

Before starting this demo application, I am assuming that you already have done CC&B set up on your local and Eclipse is configured.
What I am going to do so that I can use Business Script, Data Area, UI Map and BPA Script?
In this tutorial, I will create one UI Map which will take the person name as input and display list of all the person names as per input.
Final output screen would look like:

UI Map in ORMB/CC&B/Oracle Utility with BPA Script
UI Map in ORMB/CC&B/Oracle Utility with BPA Script

Continue reading “Step by Step tutorial for creation of Business Service, Data Area, UI Map and BPA Script in ORMB / CC&B / Oracle Utilities for beginners”