Sergeonclear

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, December 31, 2010

Tomcat remote debug

Posted on 2:04 AM by Unknown
Windows:
under tomcatHome/bin create a file called startup-debug.bat or startup.bat and add below:

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
catalina.bat jpda start


UNIX:
export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket
catalina.sh jpda start


Run the bat/sh file you just modified. Connect at port 8000 for debug..


To configure remote debugging when windows as setup as a service you edit your tomcat configuration and add these startup parameters:

C:\tomcat\bin> tomcat5w //ES//Tomcat5

-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n






Read More
Posted in | No comments

Friday, December 10, 2010

Online java IDE

Posted on 4:14 AM by Unknown
Its a shame we don't have  a proper online java editor to build full scale web applications in java.

Most of them found only allow you to compile a small code snippet or dont allow you to execute java code for security reasons.

Cant imagine the amount of progress we can make if we have a full fledged online java editor. eg: Imagine we are able to do online development of existing java projects on sourceforge site. Imagine how much code you can produce if development is as simple as opening up a browser and keying in your ideas.. Imagine how many projects u can get involved in simultaneously.


JDK6 has the new in memory as well as runtime compiler API: search JavaCompiler. Not many have taken advantage of it i believe.

Some online ide like options:
compilr - can only compile, not run
ECCO: - looks like an interesting project on SF but abandoned 3 yrs back
ideOnea simple code  compile and run project



Read More
Posted in | No comments

Wednesday, December 8, 2010

iBatis - simplify persistence

Posted on 9:16 AM by Unknown
iBatis is in between hibernate and jdbc. A somewhat ORM. It is more about simplicity.

What is iBatis ?


  • A JDBC Framework
    • Developers write SQL, iBATIS executes it using JDBC.
    • No more try/catch/finally/try/catch.

  • An SQL Mapper
    • Automatically maps object properties to prepared statement parameters.
    • Automatically maps result sets to objects.
    • Support for getting rid of N+1 queries.

  • A Transaction Manager
    • iBATIS will provide transaction management for database operations if no
      other transaction manager is available.
    • iBATIS will use external transaction management (Spring, EJB CMT, etc.)
      if available.

  • Great integration with Spring, but can also be used without Spring (the
    Spring folks were early supporters of iBATIS).


What isn't iBATIS ?


  • An ORM
    • Does not generate SQL
    • Does not have a proprietary query language
    • Does not know about object identity
    • Does not transparently persist objects
    • Does not build an object cache


Useful links:
Spring 3 + ibatis + maven sample in git : link
ibatis tutorial: link

Read More
Posted in | No comments

Wednesday, July 14, 2010

Jboss overview

Posted on 8:23 AM by Unknown
At a high level :  EJB container + Servlet container  = Jboss application server

With more and more web applications turning to spring and hibernate tomcat is more than sufficient. But I am writing down the jboss details here as part of my porting project investigation work.

Default Port: 8180
http:[jboss]/jmx-console makes managing server easier using mbeans.

JBoss Directory Structure

bin/  :Scripts to control JBoss
client/
: Libraries for use by remote clients.
docs/
  : it's documentation!
lib/
:Core libraries.
server/
: Services hosted and served. Your apps go in here.


server/
               There are three sample configurations: default(security, transaction services and RMI), minimal(logging and hot-deployment)
and all(Everything in default plus clustering, webservices) . Thee folders under this are useful:

  conf/     Meta-information for the configuration.
  data/     Data store for JBoss. This directory is created by JBoss when the configuration is started for the first time.
  deploy/  Location for the deployed components - dynamically scanned do detect any additions or changes made while JBoss is running (hot-deployment). Put apps here.
  lib/        Libraries (in addition to the core ones) required by this configuration.
  log/      Service specific logs. Like data/ this directory is created by JBoss on first instantiation.
  tmp/     Used as temporary store by JBoss. Similarly to log/ and data/ this directory is created by JBoss.
  work/    Used for JSP caching.


You can run your own instance of jboss under server/ and starting it from bin/run_[instance].bat ..what this batch file should do is set environment variables, and start jboss using org.jboss.Main -c [instance name]



Ref: http://www.novell.com/coolsolutions/feature/14912.html




Read More
Posted in Jboss overview | No comments

Wednesday, July 7, 2010

Liferay CMS/ web content management/ workflow/ staging

Posted on 9:44 AM by Unknown
Liferay out of the box has a web content management system. The web pages can mostly have these web content (articles) as web pages.
The web content resource are organized as below:

In liferay control panel you have the following for CMS:

Article
Holds the content. The article fields can be configured using a structure. Can belong to a type. Can apply a category. Can be tagged. Stored in DB column journalarticle.content as xml. Web content list and web content article portlets use these articles.

Structure
Defines all the fields the article will have like text input, text area, image input,etc . Also the velocity template can access these fields using the names configured here.

Template
An article can be displayed using a velocity template. Template can have a structure applied to it. So an article on using a structure can choose one of these templates.

Tags and categories
Provides a way to organize articles.

Document library
Documents can be uploaded. They are stored in the database. There is a document library portlet for managing this.

Image gallery
Holds images. These are available for article.


More on the workflow staging later...

Please refer my other post here for more





Read More
Posted in article, document library, image gallery, liferay web 2.0 java/j2ee, web content | No comments

Tuesday, May 18, 2010

cloud hosting monthly costs comparison

Posted on 4:08 AM by Unknown
Most of the cloud providers charge hourly. Its easier to compare costs if we can get a monthly pricing. However the hardware they provide is difficult to compate.
The simple monthly pricing formula is [cost per hour] x running 24 hrs per day x 30 days = [cost per hour] x 720 hours a month
Here is an attempt for linux as of may 2010:

 

Amazon EC2:(Standard On-Demand Instances)
Small $0.085/hr => $61.2/month
Large $0.34/hr => $244.8/month

rackspacecloud
256MB/10GB 0.015/hr => $10.95/month
512 MB/20GB 0.30/hr => $21.90/month

opsourcecloud 

0.26/hr => $191/month
http://www.opsourcecloud.net/getstarted/pricing/

Amazon does provide the Pay only for what you use. But how does it identify our usage and what it exactly means is not clear ? Yet to figure it out. Somewhere I did read that till your app is shutdown it means the CPU is used..Would it make any sense for web app...I may be wrong..

Google App engine:
-cant write to disk.
-blacklisted set of java APIs, so few apps dont work
- cant use hibernate . So most open source apps built on hibernate wont work.
- 30 seconds HTTP response limit. So cant use streaming.
- Shutsdown app if not used for certain hours. So will give you screen deaths after first access.
- Use it only if you are ready to get tied to google ORM and big table. Also no joins..duplicate your data and...grrr..
-Then why use it ? Hmmn .. But it gives basic usage stuff for free. If you are ready to align your apps to what GAE provides and live with its limitations, then you are good to go.

Cloud is still evolving i think.
For my basic app needs, I would rather prefer to setup my own boxes and network infra to cut costs and have full control.

Reference:
http://www.raditha.com/blog/archives/cloud-hosting-making-sense-of-the-pricing.html

Read More
Posted in amazon, cloud comparision price, cloud comparison blog, cloud computing monthly price, cloud usage, google app engine, opsourcecloud, rackspacecloud | No comments

Tuesday, May 11, 2010

jQuery gotchas

Posted on 4:57 AM by Unknown
1. Playing with checkboxes:
To get all the checked checkboxes from a group use :
$("input.selectArticleCheckBox:checked");

2. To hide multiple elements in a screen with the same name use class instead of id:
$('tr.filterSection').show();
This shows all elements with class filterSection in a tr

3. Iterating through an array:
       $.each(
                    articles,
                    function( intIndex, obj ){                 
                        alert(obj.value);
                    }
         );

4. Check if element is visible: $('.classMessage').is(":visible")

5. Email validation using regex:
var regexEmail= /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z0-9]{2,4})$/;                          
if(!regexEmail.test(currentFieldValue)) { }

6. Manipulating select fields
$('#selectList').val();
$('#selectList :selected').text();

7. Debugging jquery on stupid IE
//global catch all
function
handleError(e)
{
alert(’An error has occurred!\n’+e);
return true;
}
window.onerror = handleError;
Use stacktrace.js as a life saviour : stactrace.js

  Nice link here

More

Ref:  Jquery cheat sheet :
Build your own jquery plugin tutorial
spring mvc with jquery ajax
restful spring mvc

Read More
Posted in | No comments

Tuesday, May 4, 2010

Liferay 5+

Posted on 5:28 AM by Unknown
  • Liferay experiences thread link
  • Public render parameter(JSR 286) in liferay to read a request parameter: link 
  • Website search (page search based on meta tags : link
  • Building a hello word portlet using plugins SDK:link
  • Liferay and opensso integration:(quite neat) : link
  • Organization vs community : link
  • Adding validation messages in liferay : link
  • Popup in liferay : link
  • Liferay hook plugins : link : Hooks are event handlers and they are Good stuff !.  Liferay provides the following events : Application Startup Events, Login Events, Service Events                                               Gotchas : Better to use hooks as plugins. Tried in ext once and it broke other hooks.
  • Customizing labels(internationalized): Done in Language-ext.properties
    : link
  • A good review of liferay 5.x is here
  • Liferay architecture is SOA based :

* Above image is taken from book Liferay Portal 5.2 Systems Development.pdf

Read More
Posted in | No comments

Friday, April 30, 2010

Inter portlet co-ordination (JSR 286)

Posted on 1:52 AM by Unknown
Prior to JSR 286, the support for inter portlet communication was rather minimal and information sharing between different portlets was accompalished primarily using application scoped session objects or vendor specific APIs. Both of above methods were rather problematic as in the former maintaining the uniqueness of the session attribute over a complex aaplication was a concern and in the later portability of the portlet was hampered. In order to provide coordination between portlets the Java Portlet Specification v2.0 (JSR 286) introduces the following mechanisms:
  1. public render parameters in order to share render state between portlets.
  2. portlet events that a portlet can receive and send.
Also JSR 286 specifies about Portlet Events..
An example where a portlet may want to offer receiving events is for state changes triggered by simple user interactions, e.g. adding an item to a shopping cart. By offering this as an event to other portlets these can trigger adding items to the shopping cart based on the user interactions happing inside these portlets.

More details here:
http://blog.xebia.com/2009/04/19/inter-portlet-coordination-with-jsr-286/

Read More
Posted in | No comments

Wednesday, April 21, 2010

SCRUM

Posted on 7:24 AM by Unknown
A mind map : http://www.mp3monster.org/new/techie/MindMaps/SCRUM.shtml

Read More
Posted in | No comments

Thursday, March 25, 2010

JDK hidden treasures

Posted on 3:18 AM by Unknown
Couple of tools we occasionally use but knowing them is useful esp. when we want to peek into JVM.

jps  -List the java process running.
eg: jps -m -l

jvisualvm - Visualize all the VMS running. Seems to be a better option than jconsole. Comes with jdk1.6+ i think
http://java.sun.com/javase/6/docs/technotes/guides/visualvm/intro.html

jconsole -
eg: TODO: remotely manage Mbeans??

jar
eg: jar xvf --to extract, jar cvf -- to create ?

jarsigner  --useful for signing applets.
jstack --??

java  - The jvm ...
javac  - The compiler

javaw  - As far as I know useful to run a process without sticking it to the console which is opening it. eg: javaw eclipse




Read More
Posted in | No comments

Friday, March 19, 2010

Good tools for web developers

Posted on 9:08 AM by Unknown
Must have tools for web developers
Xrefresh
which works with firebug.

Basically you install 2 things , a firefox addon and a system specific xreferesh server. the addon behaves like a client and refreshes the page when you save a html/css/js in your editor

Fireshot
An excellent plugin to take screenshots and edit them all easily in the plugin.

Read More
Posted in | No comments

Thursday, March 18, 2010

Fun with XML on Oracle - XMLTypes

Posted on 10:06 AM by Unknown
To register a schema in oracle do below:
1. drop directory XMLDIR;
2. create directory XMLDIR as 'C:\';
3. select * from ALL_DIRECTORIES
4.
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'C:\oracle9i\admin\TEST\utl_file\test.xsd',
SCHEMADOC => bfilename('XMLDIR','test.xsd'),
CSID => nls_charset_id('AL32UTF8'));
5. desc DBMS_XMLSCHEMA confirms that registerSchema exists

Gotchas:
error: ORA-01031: insufficient privileges


Read More
Posted in | No comments

Wednesday, March 17, 2010

Clip chain - copy mulitple words at one go!

Posted on 9:13 AM by Unknown
Clip Chain:
The separator can be changed as often as you'd like while building the text chain—Caps Lock+Esc resets the separator to the default (nothing).

Use the Caps Lock+C shortcut to copy the currently selected text and Caps Lock+V to paste Once the chain has been pasted using Caps Lock+V, the chain is moved to the clipboard and reset.

To paste the chain again, use the standard Ctrl+V shortcut. The chain can also be reset at any time by pressing Caps Lock+Backspace.

More : http://lifehacker.com/5337238/clipchain-copies-multiple-text-strings-for-easy-pasting


Read More
Posted in | No comments

Tuesday, March 2, 2010

Playing with load - Jmeter

Posted on 3:53 AM by Unknown
Scenario:
I want to test http web service using distinct samples as it violates primary key constraints on my database.

The solution:
Java Custom Sampler can be easily configured in jmeter by:
1. Implementing JavaSamplerClient interface.
2. Copy this custom jar into [JMETRE_HOME]/lib/ext . Also any related jars if required!
3. Fire up jmeter client. > Thread Group >Add > Sampler > Java Request ..You should see your custom sampler..

The code is below:
public class CustomServiceSampler implements JavaSamplerClient {
public Arguments getDefaultParameters() {
Arguments params = new Arguments();
params.addArgument("SERVICE_URI", DEFAULT_SERVICE_URI);
params.addArgument("XML_TEMPLATE_PATH", DEFAULT_BRANCH_TEMPLATE_PATH);
params.addArgument("DATA_ENCODING", DEFAULT_DATA_ENCODING);
return params;
}

@Override
public SampleResult runTest(JavaSamplerContext context) {
SampleResult result = new SampleResult();

HttpClient client = new HttpClient();
String url = context.getParameter("SERVICE_URI", DEFAULT_SERVICE_URI);
String templatePath= context.getParameter("XML_TEMPLATE_PATH", DEFAULT_BRANCH_TEMPLATE_PATH);
String contentType= context.getParameter("DATA_ENCODING", DEFAULT_DATA_ENCODING);

PostMethod method = new PostMethod(url);
method.setRequestHeader("Content-Type", contentType);
try {
String template = FileUtils.readFileToString(new File(templatePath));
String id= (System.currentTimeMillis() + "").substring(0, 10);
result.setSampleLabel("Post xml- " + id);
logger.info("Sending POST request to "+url +" with id:"+id);
String xml = template.replaceAll("\\{ID\\}", branchId);
xml = xml .replaceAll("\\{DATE\\}", new Date() + "");

RequestEntity requestEntity = new StringRequestEntity(xml );
method.setRequestEntity(requestEntity);

result.setRequestHeaders(ToStringBuilder.reflectionToString(method.getRequestHeaders()));
result.setSamplerData(xml );

result.sampleStart();
client.executeMethod(method);
result.sampleEnd();

String response = new String(method.getResponseBody());
int code = method.getStatusCode();
logger.info("Recived response .. status code "+code +" response xml :"+response);
boolean success= code ==201 ? true:false;
result.setSuccessful(success);
result.setResponseData(response);
result.setResponseCode(code+"");
result.setResponseMessage(response);


} catch (Exception e) {
logger.error(e,e);
result.sampleEnd();
result.setResponseMessage(e.getMessage());
result.setSuccessful(false);
}
return result;
}
}

References:
http://www.scribd.com/doc/23029283/Using-JMeter-to-Performance-Test-Web-Services

Read More
Posted in jmeter load testing custom java sampler javasamplerclient xml test | No comments

Sunday, February 28, 2010

Google app engine

Posted on 1:33 PM by Unknown
An interesting read on when big table is better than RDBMS :http://highscalability.com/how-i-learned-stop-worrying-and-love-using-lot-disk-space-scale
An interesting post on full text search is here But its not so reliable.

An attempt to run few web service using spring 3 is here :
http://jshoutbox.appspot.com/




Read More
Posted in pdf 2 text | No comments

Friday, February 26, 2010

Spring 3 samples

Posted on 1:19 AM by Unknown
A good collection can be found here : https://src.springsource.org/svn/spring-samples/

Spring 3 with JSON (lib jackson) here
Another useful link : http://springbyexample.org/



Read More
Posted in | No comments

Monday, February 22, 2010

linux - the difference between hard and soft links

Posted on 4:38 AM by Unknown
Follow http://linuxgazette.net/105/pitcher.html By Lew Pitcher
Thanks to Lew Pitcher. Very well explained..

Read More
Posted in linux - the difference between hard and soft links | No comments

Saturday, February 20, 2010

tabbed ms dos/putty console

Posted on 4:28 PM by Unknown
Are you tired of keeping multiple dos/console tabs open (like me .... :D ..... phew!!)
This is quite useful for programmers I think:
Refer for details:
http://www.downloadsquad.com/2006/07/05/console-tabbed-command-prompt-for-windows

To download an opensource tabbed console(support dos, cygwin,etc) follow :
http://sourceforge.net/projects/console/files/

For remote connecting to linux, there is Putty Connection manager. My favourite.. Maybe console developers can learn from them.


Read More
Posted in tabbed ms dos console cygwin console | No comments

Monday, February 15, 2010

SVNKit - subversion online?

Posted on 9:32 AM by Unknown
* Pure java implementation of subversion client.

Why it is of interest??
Imagine you want to maintain templates in your subversion as well as make it available to the live web application. There is some effort in creating the template, testing it and then syncing it over to the live application..

If we can get the subversion online then this can be done pretty easily saving the sync effort. Pretty much like a CMS.

Java example API usage  http://svnkit.com/feed/ExamplesList.html
Architecture : http://www.svnkit.com/documentation.html

Maven dependency:
    <dependency>
        <groupId>com.svnkit</groupId>
        <artifactId>svnkit</artifactId>
        <version>1.1.0</version>
    </dependency>




Read More
Posted in | No comments

Saturday, February 13, 2010

setting up a static ip with SKY broadband

Posted on 1:23 PM by Unknown
Setting up a static ip on SKY broadband
  • log into the router
  • Navigate to LAN IP SET UP under advanced settings.
  • Click add under address reservation
  • On the screen that appears choose the device you want to give a fixed IP to
  • Select with the radio button to the left
  • Change the IP if you want/need to
  • Click add
  • Click cancel to return to the main screen
  • Click apply
  • Go to WAN setup and setup this IP (which you want to make public)
  • Go to whatismyip.com to get your public ip..
  • Thats it you got a public IP.

Note: going public will make your PC available to anyone...beware
Read More
Posted in setting up a static ip on SKY broadband | No comments

Thursday, February 11, 2010

Virtualization with sun virtualbox

Posted on 12:40 PM by Unknown

Windows xp crashed again. Luckily I had the stable ubuntu still running..
Its the nth time its happening. Is there a solution at all for windows sh** .


Well I came across Sun VirtualBox and got windows xp running from Ubuntu in just a few clicks and keystrokes.. The clicks are below:

1. From ubuntu download http://www.virtualbox.org/wiki/Downloads 
2. Install virtualBox
3. From command prompt type in VirtualBox to get the virtual box window.
4.  Follow this video http://www.youtube.com/watch?v=ch8X86R6d-g
5. Put xp cd and create a  new instance of virtualbox.
5. Read this for details : http://www.virtualbox.org/manual/UserManual.html#id2495036
6. Thats it you got windows xp running from Ubuntu..

To share a drive across virtual machines you just have to map the drive.

From your host machine(ubuntu) type in console
$ VBoxManage sharedfolder add "Windows XP" -name "fun" -hostpath "/media/fun"

Then from windows command prompt type net use p: \\vboxsvr\fun
Voila you got your shared drive on p:

Whats more !! have fun with virtualization...
Thanks to this thread http://ubuntuforums.org/showthread.php?t=367155
Still cant get drive access? follow this http://ubuntuforums.org/archive/index.php/t-627847.html

The satan windows can now run under the sane hands of ubuntu...lol



 




Read More
Posted in | No comments

spring 2.5.6 performance monitoring

Posted on 9:16 AM by Unknown
1. update the applicationContext.xml as below:

 <!--  Performance monitoring. Log level should be set to TRACE to monitor the performance.  -->
    <aop:config>
           <aop:advisor pointcut="execution(* com.pkg..*.*(..))" advice-ref="performanceMonitor"/>
    </aop:config>
    <bean id="performanceMonitor" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/>

2. Modify log4j.properties as below:
log4j.logger.org.springframework.aop.interceptor.PerformanceMonitorInterceptor=TRACE

3. The following pom configuration is necessary
<!-- monitor performance dependencies -->
        <dependency>
          <groupId>aspectj</groupId>
          <artifactId>aspectjweaver</artifactId>
          <version>1.5.4</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2</version>
        </dependency>

<!-- Spring dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.6</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>2.5.6</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>2.5.6</version>
        </dependency>

4. You will see the logs as below
TRACE - StopWatch 'com.xyz.dao.procedure.StoredProcedureFactory.getStoredProcedure': running time (millis) = 31
......


Read More
Posted in | No comments

Wednesday, February 10, 2010

Spring annotations with spring-mock gotchas

Posted on 10:01 AM by Unknown
Spring version used: Spring 2.5.6 but spring-mock2.0 (as that's the latest version for mock)

Problem: Junits do not run from dos(when using spring-mock) . Throws  weird exceptions:
java.lang.NoSuchMethodError:springframework.core.annotation.AnnotationUtils.findAnnotationDeclaringClass(Ljava/lang/Class;Ljava/lang/Class; org.)

The cause: spring-mock 2.0 tries to load spring2.0 jars into classpath screwing up junits run using spring annotations.

Solution:  Tried excluding all the spring-mock dependencies. This should have ideally worked. But I was not able to get it exclude it ...dont know could be a  maven version bug?? Hence had to modify the local pom.xml of spring-mock and removed all spring 2.0 dependencies. Put it into our local maven mirror(archiva).

How did i find this out: By using mvn -X test one can see all the jars loaded in classpath
Details: See a similar problem well explained here




Read More
Posted in Spring annotations with spring-mock not working 2.0 2.5.6 | No comments

Friday, February 5, 2010

Oracle thin vs OCI(type II/thick) drivers

Posted on 10:18 AM by Unknown
1. Thin drivers are type 4 and pure java implementations.
Remember to uses classes12.jar instead of ojdbc14 when working with CLOBs.. Or else it throws this
weird exception:
java.sql.SQLException: ORA-00600: internal error code, arguments: [kolaHashFind:hash table], [], [], [], [], [], [], []



2. OCI drivers are thick drivers(type II) and use native libraries to interact with oracle db server.
Usually required when we need to work with XMLType to the oracle db server.


For XMLType its more complicated as it expects xdb.jar and oci jar (ojdbc5.jar i think).

OCI could be a pain:
Check http://myjdbc.tripod.com/basic/jdbcoci.html

I think there could be compatibility issues with OCI esp. as the client driver should match the oracle server version installed. Well that's a guess, will find out and post more here...

The exceptions that were faced with oci driver are below:
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path >> Guess: must be missing a native dll. does it mean u need a oracle client 10 ?
java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path >> Guess: must be missing a native dll. does it mean u need a oracle client 11 ?
java.lang.NoClassDefFoundError: oracle/jdbc/oci8/OCIDBAccess
java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
>> occurs when we need to work with XMLType found in xdb.jar which in turn depends on xmlparserv2.jar from oracle...


This is such a pain esp. with cryptic clues what oracle gives.. Oracle DB is good but why are the jdbc clients so bad.. There are so many distributions of oracle driver and the jar names are so confusing..overall we spend lot of time sorting out jdbc drivers of oracle during development i think.. Oracle jdbc folks are u listening....if yes clean up the crap and keep it simple silly...



IMPORTANT:
On different oracle jdbc bundles. Must read:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#02_07
Why couldnt I understand the naming convention of jars before:

ojdbc6.jar - All the classes to support basic functionality for the Thin and OCI drivers when using JDK 1.6 (JSE 6)
ojdbc5.jar - All the classes to support basic functionality for the Thin and OCI drivers when using JDK 1.5 (JSE 5)
classes12.jar - Classes for the Thin and OCI drivers when using a Java 1.2 or 1.3 VM.
ojdbc14.jar - Same as classes12.jar except for use with Java 1.4 VMs

More dependencies for OCI:
libocijdbc.so (Solaris)Native library for the JDBC OCI driver.
  • for JDBC 8.x.x drivers, the is 8
  • for JDBC 9.x.x drivers, the is 9
  • for JDBC 10.x.x drivers, the is 10
  • for JDBC 11.x.x drivers, the is 11
This file should be locatable via your LD_LIBRARY_PATH setting.

ocijdbc.dll (Windows)Similar to above, except on Windows platforms. This file should be locatable via your %PATH% setting.



Read More
Posted in Oracle thin vs OCI(type II/thick) drivers | No comments

Tuesday, January 26, 2010

Xpath

Posted on 5:37 AM by Unknown
XPath uses path expressions to select nodes or node-sets in an XML document.
It contains a library of standard functions and is a major element in XSLT .A W3C recommendation


Several Path Expression Result
//book/title | //book/price Selects all the title AND price elements of all book elements
//title | //price Selects all the title AND price elements in the document
/bookstore/book/title | //price Selects all the title elements of the book element of the bookstore element AND all the price elements in the document


Wildcard Path Expression Result
/bookstore/* Selects all the child nodes of the bookstore element
//* Selects all elements in the document
//title[@*] Selects all title elements which have any attribute

Path Expression Result
/bookstore/book[1] Selects the first book element that is the child of the bookstore element.

Note: IE5 and later has implemented that [0] should be the first node, but according to the W3C standard it should have been [1]!!

/bookstore/book[last()] Selects the last book element that is the child of the bookstore element
/bookstore/book[last()-1] Selects the last but one book element that is the child of the bookstore element
/bookstore/book[position()<3] Selects the first two book elements that are children of the bookstore element
//title[@lang] Selects all the title elements that have an attribute named lang
//title[@lang='eng'] Selects all the title elements that have an attribute named lang with a value of 'eng'
/bookstore/book[price>35.00] Selects all the book elements of the bookstore element that have a price element with a value greater than 35.00
/bookstore/book[price>35.00]/title Selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00



Ref:

w3schools
For trying xpath use try me
java xpath http://onjava.com/pub/a/onjava/2005/01/12/xpath.html

Read More
Posted in xpath xml xquery | No comments

Thursday, January 14, 2010

RESTful.........what?

Posted on 4:57 AM by Unknown
What is REST?
wiki says representational state transfer is a style of software architecture for distributed hypermedia systems..  The constraints described are :
  • Client Server
  • Stateless
  • Cacheable
  • Layered system
  • Code on demand
  • Uniform interface
RESTful web services (aka RESTful web API);
  Comprised of 3 aspects - URI, MIME type supported, operations supported using HTTP methods.

Public implementations : Atom publishing protocol, Suns cloud API etc

Arent all our web applications RESTful then?
So what does it mean for a java developer?
Answers here are quite close
http://www.rubyrailways.com/great-ruby-on-rails-rest-resources/

Everything should be treated as a resouce on the web (not a page). The clear advantage of this is that the same URL can serve content in different formats. Currently most of the sites serve html pages, but they dont work on a mobile or a client expecting xml feeds,etc.

Think of REST as a sentence
• HTTP Methods are verbs
• URIs are nouns
• This grammar is currently being abused by existing websites.

Action implied in the URI
• Implied action conflicts with HTTP method
Conflicting
GET http://addressbook/contacts/destroy/1

Ref:
http://en.wikipedia.org/wiki/Representational_State_Transfer
http://www.rubyrailways.com/great-ruby-on-rails-rest-resources/

Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • LinuxPerformance Tuning(apache,tomcat,linux) and related
    Web profiling -- HTTPAnalyzer -- -- YSlow --CSS,Javascript report , time/size measurement for individual component is good. -- F...
  • (no title)
    Hardware/Software stack:  iPhone 3Gs having iOS 5.1.1(latest as of today).  The Xcdode 4.2 failed to detect this iphone as it has support on...
  • Spring interceptor ordering
    SimpleUrlHandlerMapping uses a hashMap to hold the interceptors. Ordering can only be guaranteed by setting  order property.. By default it ...
  • SVN/ Subversion Tips and traps
    SVN could be tricky and waste a hell lot of time. Case Issue : Normally we run SVN server in linux. Our dev env will be in windows NT. Windo...
  • Liferay CMS/ web content management/ workflow/ staging
    Liferay out of the box has a web content management system. The web pages can mostly have these web content (articles) as web pages. The web...
  • Cobertura- junit coverage tool
    First, you need to add a task definition to the build.xml file. This top-level taskdef element specifies that the cobertura.jar file is i...
  • XSLT caching Transformers
     The usage of cached transformer objects is recommended here A sample implementation of CachingTransformerFactory is here The above code abs...
  • Rewrite rules in apache and IIS
    Well we can control how the server serves stuff to clients by defining rewrite rules. As servers are dumb, its important to explain well abo...
  • Real-Time Tracking and Tuning for Busy Tomcat Servers
    A very nice article which details on possible options for tomcat server monitoring to tweak its performance. http://www.devx.com/Java/Articl...
  • External Javascript from Java Servlets
    Copied from http://myappsecurity.blogspot.com/2007/01 Like to thank anurag for the content. /breaking-same-origin-barrier-of.html External ...

Categories

  • AJAX javascript
  • All about UK Visa HSMP VS H1
  • All about UK Visa HSMP VS H1 hsmp assistance
  • amazon
  • android apps ship control radio hindi
  • Apache 2.x setup Quick guide for Linux
  • apache commons configurator usage
  • apache commons usage
  • arsenals for developers
  • article
  • Batch script to load developer environment
  • Blind folded chess
  • Castor castor convert dtd to xsd
  • cloud comparision price
  • cloud comparison blog
  • cloud computing monthly price
  • cloud usage
  • Cobertura- junit coverage tool
  • Code generators
  • cron jobs expressions
  • cruisecontrol cruise control
  • debugging eclipse tips
  • developer tools
  • document library
  • easy mock jmock vs mocking java tdd
  • External Javascript from Java Servlets
  • fedora 9 lenovo 3000 n200 windows xp dual boot problem
  • Fire fox plugins and tweaks
  • Free PHP hosting
  • gods debris the religion war scott adams dilbert
  • google app engine
  • gwt javascript
  • hibernate second level cache
  • i18n locale localization internationalization spring liferay portlet locale
  • ibatis sybase mapping
  • image gallery
  • iphone apps bri8 apple
  • iphone shsh 3gs ipsw downgrade ifaith tinyumbrella ios5.1.1 to ios5.0
  • java
  • java JDBC
  • javascript junit testing
  • Javascript trouble shooting tool
  • Jboss overview
  • jmeter load testing custom java sampler javasamplerclient xml test
  • JNDI test JSP page
  • Joomla CMS
  • JProfiler setup jprofiler on linux
  • jquery IE AJAX issues
  • jquery spring AJAX
  • keyboard music java typing soothing notes auto suggest
  • liferay kids version
  • liferay web 2.0 java/j2ee
  • linux - the difference between hard and soft links
  • linux mysql
  • linux mysql setup quick start
  • Linux ssh autologin with putty
  • LINUX usefuls
  • linux)
  • LinuxPerformance Tuning(apache
  • log4j setup useful
  • lucene solr
  • mac m701 android skype not working crash
  • maven
  • maven cut reduce build time
  • microsoft ODBC oracle dll connection issues
  • Mobile Ad Services (adwhirl)
  • opsourcecloud
  • oracle connect by hierarchy
  • oracle table previlege
  • Oracle thin vs OCI(type II/thick) drivers
  • pdf 2 text
  • Pega PRPC
  • php
  • rackspacecloud
  • Rewrite rules in apache and IIS
  • scaffold
  • setting up a static ip on SKY broadband
  • setup quick start
  • Single Sign on - OpenSSO with Liferay
  • smart gwt
  • smtp email test mock server james
  • SMTP MAIL telnet windows
  • Software tools mind map freemind j2ee tools
  • Speed typing tips.
  • Spring + Hibernate Usefuls BaseDAOHibernate
  • Spring annotations with spring-mock not working 2.0 2.5.6
  • spring jndi datasource lookup
  • Spring portlet mvc and spring servlet mvc validation
  • Spyware trojan and virus removal tools
  • struts magic
  • SVN/ Subversion Tips and traps
  • tabbed ms dos console cygwin console
  • Texter - An auto text expander autotyper
  • Textpad tricks
  • The art of debugging
  • tomcat
  • Tomcat Exploded war - cut deployment time
  • Tomcat on linux tips
  • Tomcat on linux tips commands
  • TypeIt4Me
  • Typinator
  • Useful Eclipse Plugins
  • Useful Eclipse Plugins eclipse shortcuts keys
  • Useful tools
  • web content
  • xcode cocos2d iphone box2d
  • xpath xml xquery

Blog Archive

  • ►  2013 (19)
    • ►  August (17)
    • ►  July (1)
    • ►  January (1)
  • ►  2012 (7)
    • ►  August (1)
    • ►  June (4)
    • ►  April (2)
  • ►  2011 (20)
    • ►  November (1)
    • ►  October (1)
    • ►  August (1)
    • ►  July (3)
    • ►  June (1)
    • ►  April (2)
    • ►  March (4)
    • ►  February (1)
    • ►  January (6)
  • ▼  2010 (27)
    • ▼  December (3)
      • Tomcat remote debug
      • Online java IDE
      • iBatis - simplify persistence
    • ►  July (2)
      • Jboss overview
      • Liferay CMS/ web content management/ workflow/ sta...
    • ►  May (3)
      • cloud hosting monthly costs comparison
      • jQuery gotchas
      • Liferay 5+
    • ►  April (2)
      • Inter portlet co-ordination (JSR 286)
      • SCRUM
    • ►  March (5)
      • JDK hidden treasures
      • Good tools for web developers
      • Fun with XML on Oracle - XMLTypes
      • Clip chain - copy mulitple words at one go!
      • Playing with load - Jmeter
    • ►  February (10)
      • Google app engine
      • Spring 3 samples
      • linux - the difference between hard and soft links
      • tabbed ms dos/putty console
      • SVNKit - subversion online?
      • setting up a static ip with SKY broadband
      • Virtualization with sun virtualbox
      • spring 2.5.6 performance monitoring
      • Spring annotations with spring-mock gotchas
      • Oracle thin vs OCI(type II/thick) drivers
    • ►  January (2)
      • Xpath
      • RESTful.........what?
  • ►  2009 (32)
    • ►  December (5)
    • ►  November (2)
    • ►  September (3)
    • ►  August (6)
    • ►  June (4)
    • ►  May (4)
    • ►  April (3)
    • ►  March (2)
    • ►  February (3)
  • ►  2008 (28)
    • ►  December (1)
    • ►  October (2)
    • ►  September (2)
    • ►  August (4)
    • ►  July (7)
    • ►  June (1)
    • ►  April (2)
    • ►  March (2)
    • ►  February (2)
    • ►  January (5)
  • ►  2007 (24)
    • ►  December (3)
    • ►  November (2)
    • ►  October (6)
    • ►  September (1)
    • ►  August (3)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile