Friday, July 31, 2015

The declared package does not match the expected package “”? (100/285 technotes for 2015)

The issue description:

The declared package “org.jboss.as.quickstarts.helloworld” does not match the expected package “main.java.org.jboss.as.quickstarts.helloworld” HelloService.java /jboss-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld line 17 Java Problem

image




Resolution:


To resolve this issue.

Right click on the the project → Properties → Java Build Path → Source

Click on the project →


image


Add a new Source folder src/main/java


image


Remove the old src folder


image

Thursday, July 30, 2015

What is JBOSS EAP? (99/285 technotes for 2015)



JBoss Enterprise Application Platform is a rigorously tested, stable, supported platform for developing and deploying mission critical Java applications and services. 

It integrates code from the 

JBoss EAP is certified on 17 operating systems, 5 Database Management systems and JVM combinations. It also integrates with 


Advantages:

  • 0 licence fee, significantly lower Total Cost of Ownership (TCO)- upto 70% savings.
  • avoid vendor lock in ?????


  • With 24x7x365 support with 1 hour SLA you are guaranteed support when you need it.

Monday, July 27, 2015

Useful Java syntaxes.

org.apache.commons.lang3.Validate

This class assists in validating arguments. The validation methods are based along the following principles:  

———————————————————————————

Wednesday, July 22, 2015

What is the difference between JAXB and JAXP? (98/285 technotes for 2015)

JAXP (Java API for XML Processing) is a rather outdated umbrella term covering the various low-level XML APIs in JavaSE, such as DOM, SAX and StAX.

  1. Create a SAX Parser or DOM Parser and then PArse the data, if we use DOM, it may be memory intensive if the document is too big. Suppose if we use SAX parser, we need to identify the beginning of the document. When it encounters something significant (in SAX terms, an “event”) such as the start of an XML tag, or the text inside of a tag, it makes that data available to the calling application.
  2. Then Create a content handler that defines the methods to be notified by the parser when it encounters an event. These methods, known as callback methods, take the appropriate action on the data they receive.

JAXB (Java Architecture for XML Binding) is a specific API (the stuff under javax.xml.bind) that uses annotations to bind XML documents to a java object model.

  1. Bind the schema for the XML document.
  2. Unmarshal the document into Java content objects. The Java content objects represent the content and organization of the XML document, and are directly available to your program. After unmarshalling, your program can access and display the data in the XML document simply by accessing the data in the Java content objects and then displaying it. There is no need to create and use a parser and no need to write a content handler with callback methods. What this means is that developers can access and process XML data without having to know XML or XML processing

References: 

http://stackoverflow.com/questions/2801502/what-is-the-difference-between-jaxp-and-jaxb

Increase Heap Memory in Websphere(97/285 technotes fpr 2015)

Method 1: Using the administrative console

Open the administrative console.

Navigate to Servers > Server Types > WebSphere application servers > <servername>

Navigate to Server Infrastructure > Java and Process Management > Process Definition

Navigate to Additional Properties > Java Virtual Machine > General Properties

Define the values (in MB) for ‘Maximum heap size’ and/or ‘Initial heap size’.

Restart the server.

Note: If the heap size is already low, the administrative console might not open. In such cases, use some other method to configure the heap size.

Method 2: By editing the configuration files

This method should be used with caution.

Search for a file named server.xml in your WebSphere installation.

Generally, the location of this file is as follows:

<profilehome>/config/cells/<cellname>/nodes/<nodename>/servers/<servername>/server.xml

Select the server.xml specific to your server and edit it to add/modify/delete the attributes @initialHeapSize and @maximumHeapSize of the element <jvmEntries> The value of these attributes is the heap size in MB.

For example:

<jvmEntries ... initialHeapSize="2048" maximumHeapSize="3072" ...>
...
</jvmEntries>

Restart the server after saving the changes to server.xml.


References:

https://blakboard.wordpress.com/2013/05/15/how-to-configure-heap-size-for-websphere-application-server/

Tuesday, July 21, 2015

ModelMapper - Simple, Intelligent, Object Mapping.

ModelMapper - Simple, Intelligent, Object Mapping.

SVN CLEANUP FAILS(96/285 technotes for 2015)



What to do is SVN Cleanup Fails? Please follow the guide lines below.


Prerequisites

  1. Download and unzip sqlite3 shell tool, e.g. sqlite-shell-win32-x86-3080803.zip
  2. Adjust paths in the commands below to match your environment

Fix (manual)

Run this if you just want to test if this helps

** I placed the sqllite3.exe in the same folder where we have wc.db

D:svn_pmp.svn>sqlite3.exe wc.db
SQLite version 3.8.10.2 2015-05-20 18:17:19
Enter “.help” for usage hints.
sqlite> select * from WORK_QUEUE;
812|(file-commit pmp-services/src/main/java/com/hixapi/pmp/service/plan/impl/mapping/PlanRateMapping.java)
sqlite> delete from WORK_QUEUE;
sqlite> .quit

Fix (automated)

If previous step worked for you, consider automating the process with these steps

  1. Go to your .svn folder, e.g.

    D:svn_pmp.svn
  2. Copy sqlite3 shell tool there
  3. Create a fix-svn.bat file in that folder
  4. Next time you need to fix it, just run the shortcut on your desktop

Insert scripting code, and adjust paths

"d:svn_pmp.svnsqlite3.exe" wc.db "delete from WORK_QUEUE"
"C:Program FilesTortoiseSVNbinsvn" cleanup "D:src"

Save bat file and make a shortcut to your desktop

References:

https://changilkim.wordpress.com/2012/12/10/svn-cleanup-fails/

http://stackoverflow.com/questions/18000363/tortoisesvn-wont-allow-me-to-add-any-files

Tuesday, July 7, 2015

Which ESB to choose? (95/285 technotes for 2015)

Mule ESB - 
  • first successful open source ESBs 
  • a commercial enterprise version is available -  offers additional functionality and support for the product
  • graphical editors for an efficient implementation of integration scenarios
  • connectors for B2B products such as SAP or Salesforce
  • functionality of a suite is missing in Mule ESB - products from other vendors has to be used
  • small community,  a restrictive licensing model and limited availability of the source code
Fuse ESB - 
  • based on Eclipse and very intuitive.
  • based on de facto standards in the integration environment such as Apache CXF and Apache Camel 
IBM ESB / IIB - 

  • Based on the research by Forester - conducted by IBM - the performance and maturity of the product IBM IIB makes to significantly ahead of the game.


References:
http://www.infoq.com/articles/ESB-Integration
http://bit.ly/1JT0iz1 - in favour of IBM IIB

JBoss Fuse vs IBM ESB? (94/285 technotes for 2015)

Price:
  • IBM products has a license cost and a support cost.
  • JBoss does not have a License cost - but has a subscription cost. Red Hat JBoss Fuse subscription is over $823K less than IBM WebSphere Enterprise Service bus at list price—or just 7.3% of the IBM cost.
Interest Over Time: 
Click on the link to see how Google Trends shows the interest over the time between the two products and the latest Integration technology - Apache Camel (which is used in JBoss Fuse)

Websphere ESB vs (Jboss Fuse & Apache Camel) (live link)

Sample below - the blue line shows decrease in interest IBM WebSphere technologies



Support:
  • RedHat JBoss Fuse can be used in any customer locations. 
  • The same is applicable for IBM ESB (except IBM WESB - Registry Edition or Retail Edition)
Developer Tooling:
  • RedHat JBoss Developer Studio is used for all Middleware development. 
  • Similarly IBM Websphere Integration Developer used for all development purpose. IBM tooling is more matured - but Red Hat is catching up.
Development:
  • JBoss Fuse development is extremely flexible - developers can swtich between graphical and xml views. Developers can can write a Apache Camel entirely in Java. 
  • IBM does not encourage switching between gui mode and xml mode. 
Other Tools:
  • With Red Hat Subscription, developers can choose to explore all the RedHat JBoss Middleware platforms like RedHat JBoss Data Grid and BRMS etc. 
  • This is not possible with IBM.
Building Integration using patterns:
  • RedHat JBoss uses Apache Camel -  open source, out of the box, standards based integration patterns based out of the book -  Enterprise Integration Patterns by Gregor Hohpe and Bobby Woolf.
  • IBM WESB does not allow pattern based development
Server deployment footprint:
  • RedHat JBoss Fuse requires 100mb free disk space and 2GB RAM. This can be even tuned and optimize. 
  • IBM in geneal required 6GB RAM to run IBM WESB (including IBM Application Server).
Embedded Java Development:
  • Use the Camel core component of Red Hat JBoss Fuse to embed routes in Java applications. This kind of feature is not available in IBM ESB.
Reliable Messaging:
  • RedHat JBoss Fuse uses ActiveMQ - an open source software with a very small footprint. ActiveMQ. 
  • It has several other benefits over IBM Websphere JMS. Please see link below for more info.
Transport Bindings
  • RedHat JBoss Fuse supports all the different types of transport binding including HTTP, JMS, HTTPS, FTP. 
  • On top of that Camel provides 125 connectors to varied systems.
References:

What are the components of JBoss Fuse? (93/285 technotes for 2015)


JBoss Fuse architecture and components - 




















Apache Camel - is a
  • 1. Simple
  • 2. Modular
  • 3. Open Source
  • 4. Java Library
  1. Connecting various components together, provide transformation, implement routing and also include Business Logic. 
  2. This is a rule based routing and mediation engine using EIPs (Enterprise Integration Patterns).
  3. Embed in any JVM and use any dependency injection framework
  4. Embed your integration solution directly where you need to.
  5. It has 100's of components already
  6. Huge community
  7. Also provide Domain Specific Language - you can use Java / Scala / ... or XML to decribe your flows
  8. For XML there is support for visual tooling
Apache CXF -
Apache ActiveMQ is an
  • open source message broker written in Java together with a full
  • Java Message Service (JMS) client.
Apache Karaf is a
  • modern and 
  • polymorphic container. It’s a 
  • lightweight, 
  • powerful, and 
  • enterprise ready container powered by OSGi. 
  • You can deploy different kind of applications in Karaf, OSGi or non-OSGi.
Fuse Fabric is a
  • technology layer that allows a 
  • group of containers to form a cluster that 
  • shares a common set of configuration information and a 
  • common set of repositories from which to access run-time artifacts.









What is JBoss Fabric? (92/285 technotes for 2015)



Fuse Fabric is a runtime environment that leverages capabilities of Apache Karaf, the container underlying JBoss Fuse, to provide centralized configuration and provisioning capabilities. In brief, Fuse Fabric provides the ability to create container instances running locally or remotely, including on cloud environments like Amazon EC2 and Rackspace. You can then create and apply Profiles that define what OSGi bundles and associated configurations (name / value pairs) to apply to each managed container.


References:

https://github.com/FuseByExample/docs/blob/master/deploy-using-fabric/README.md