Rajeev Ravindran

Ranch Hand
+ Follow
since Aug 27, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rajeev Ravindran

Im using Weblogic 10.3.1. I have server defined in weblogic and on server startup i have defined a variable

in TEST enviroment , this variable will have value TEST and in PROD it will be PROD.

My questions are :
1) is it the right way to define an environment variable ?
2) how can i access the variable and value from JAva?

I tried System.getProperty("server.env"); but its returning null..

Thanks in advance,
12 years ago

anyone has any idea about the logic behind looking up businesses in google maps. if i say "pizza near 92109" in google maps, i put markers around the zipcode for pizza places. I was trying to do something same with range too. say " 25 miles with in the radius of zipcode" .. it is possible to find the distance between 2 zipcodes.. if i say " pizza near 25 miles of 92109" one option i can think of is finding all pizza location in my database and find the distance of the business from the specified zipcode and if it falls with in the radius, display it.. I didnt really like that idea that much.
other option would be add region for each business, find the region from the zipcode and search for matching business in the region..

I would love to hear more ideas or suggestions on the same.

Thanks for your time..

- Raj
13 years ago
these are the ones i tried.



didn't help me with the desired output im looking for. "java-diff-utils" returns patches which i can use to create "unified format" with context info


13 years ago
I was able to generate the basic diff output . if you are on unix box, the command would look like

$ diff file1.txt file2.txt

To get "Unified Format" , the command on unix is

$ diff -u file1.txt file2.txt

specifically I'm trying to generate the output which should be same as that of

$ diff -aNU20 file1.txt file2.txt

looking at some jars available, i think its possible to create the desired output I'm looking for, with additional coding and some math logic.
Python comes up with package for creating unified diff, http://docs.python.org/library/difflib.html

Looks like there is no solid API available in java for this requirement.

Thank you for the replies, really appreciate looking at this issue for me.

13 years ago
yes, thats what i meant "Unified Diff Format"

13 years ago

Is there any Java API for creating unified format file ? After doing some search i found this for creating diff file http://www.bmsi.com/java/#diff, but i don't see any option to create unified format . http://en.wikipedia.org/wiki/Diff#Unified_format

If anyone is aware of Java API to create Unified Format, please let me know. Thanks in advance.

~ Raj
13 years ago

I have a webservice client program. I used axis wsdl2java to generate client. I am able to run the client and display value returned by webservice. I used juni test class to connect to webservice through my webservice client.
If i deploy the same client jar in a 3rd party software and access my webservice through this my client program Im getting the following exception. I am not seeing any calls being made to webservice implementation class.. I am using maven assembly plugin to create the jars, so the chances of missing dependent jars are minimal.

2010-02-08 23:34:24,270 [main] DEBUG org.apache.axis.SOAPPart - current form is FORM_SOAPENVELOPE
2010-02-08 23:34:24,270 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(toAxisFault00)
2010-02-08 23:34:24,270 [main] DEBUG org.apache.axis.enterprise - Mapping Exception to AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultString: java.lang.NullPointerException: Cannot invoke method get() on null object
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException: Cannot invoke method get() on null object
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1772)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2923)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)

i am running out of ideas. I found few links googling but the issue is not yet resolved. Any help is appreciated.

14 years ago
got it working
14 years ago

i have the following in my pom.xml ( not copying the entire pom file )

i did some reading and found the above code in apache site to include manifest file to maven, but it doesn't seem to be working. Am I missing something ?
I use the following command to build jar file

> mvn clean install

it cleans, compiles, run testcases and create jar file. If i open the jar file and look for the manifest file, i dont see the entries i made in "src/main/resources/META-INF/MANIFEST.MF", the manifest i find in the jar is auto-generated by maven i guess. I want to add the manifest.m from the resources folder to be added to the generated jar. Any help on this is appreciated.

this is what i have in my manifest

14 years ago
1.6 in my local environment and 1.5 in unix boxes

barbary{39}$ java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Server VM (build 1.5.0_11-b03, mixed mode)

I usually declare the variable as String instead of Object but for some reason i had to define it as an object for this application.. An easy fix will be to use String literal instead of defining variable in util class but i would hate to do that.
14 years ago
FAUtil is my util class and IN_QUEUE is the static variable defined inside the class.
14 years ago
LOL are you gonna pay me for doing your job ? try it yourself and if you get into issues, someone will help you. Hope i don't sound rude !!

14 years ago
i dont really understand your question but i did a quick test and this is what i got !! you don't need to keep Emp as inner class as i have defined.

14 years ago

i have a static variable defined in my util class

public static final Object IN_QUEUE = "In Queue";

i see that FAUtil.IN_QUEUE.toString() threw null pointer exception and after bouncing the container ( the code is part of a web application deployed on OC4J) it started working again. I did see this issue once or twice during the development time but wasnt able to reproduce , it happened randomly.

I cant find any valid explanation for static final object throwing nullpointer exception. any comments ?

14 years ago