java

Getting SEVERE Error:filterStart when trying to deploy ext. Please help.

Hello, Im trying to setup the ext environment for Liferay v5.1. I have downloaded the source code which is liferay-portal-src-5.1.2. And,im using the Liferay Tomcat bundle liferay-portal-tomcat-6.0-5.1.2. I get the error "SEVERE Error:filterStart" when i run the startup command in the tomcat folder of my liferay tomcat bundle. For your...

Why should I care that Java doesn't have reified generics?

This came up as a question I asked in an interview recently as something the candidate wished to see added to the Java language. It's commonly-identified as a pain that Java doesn't have reified generics but, when pushed, the candidate couldn't actually tell me the sort of things that he could have achieved were they there. Obviously be...

Static pages in Jboss

Hi. I have a noobish question. Probably a silly one. I have a static html page; that I want to deploy with my existing app on jboss. I put my static page xyz.html in my xyz-app.war folder in jboss. I restarted the jboss and tried to hit http://localhost:8080/xyz-app/xyz.html it doesn't come up as the control goes to Ruby Routes cont...

Decode JSON data in Java

Hi, I'm used to PHP, and decoding json data is just a line of code. What would be the easiest way to do this in java? ...

Java VolatileImage - validate() vs contentsLost()

When using VolatileImage to do accerlerated Java2D operations, how do you properly use the methods validate(GraphicsConfiguration) and contentsLost() to ensure that nothing goes wrong. When do you call which method? ...

Could I get the name of current reference within Java?

public class RefName { void outRefName() { System.out.println("the current reference name is" + xxx); }; }; public static void main(String[] args) { RefName rf1 = new RefName(); rf1.outRefName(); // should be rf1 RefName rf2 = new RefName(); rf2.outRefName(); // should be rf2 }; As the code above shows,could I mak...

How to get surrounding method in Java source file for a given line number

I have a line number of a Java source file and want to get the sourounding method for that line number programatically. I looked into ANTLR which didn't help me much. Janino (http://www.janino.net) seems promising, I would scan and parse (and if necessary compile) the code. Then I could use JDI and ReferenceType.locationsOfLine(int li...

What is the correct way of overriding hashCode () and equals () methods of persistent entity?

I have a simple class Role: @Entity @Table (name = "ROLE") public class Role implements Serializable { @Id @GeneratedValue private Integer id; @Column private String roleName; public Role () { } public Role (String roleName) { this.roleName = roleName; } public void setId (Integer id) { ...

Java SSLSocket handshake failure

I'm trying to find a way to establish a connection beetwen a Java client and a C server using SSL. This is the java client: import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocket...

Class object in Objective C

I am coming from Java to Objective C, and the idea of a class object has me wondering about similarities with Java. From the Objective C guide in Apple documentation: A class definition's information is compiled and recorded in data structures made available to the runtime systems. The compiler creates just one object, a class object...

HTML: Mis-Typing Good Or Bad?

I happened to write this: <input type="hdnStatus" name="hidden" value="1" /> Instead of: <input type="hidden" name="hdnStatus" value="1" /> I was surprised that the first line generated a text box with no correct type specified. If first line generates text box, then is the below line of any use: <input type="text" name="tbox" va...

How to make Screen Transistion effect in blackberry application?

I want to make slide transition effect in my blackberry application from navigating one screen to another screen.But when i collect information regarding this i can know that this effect only possible with 5.0 version.Is there any way to achieve this effect in lower version. ...

Annotation to disable JavaDocs

Is there an annotation to declare that a certain method will not be included in the JavaDocs even though it is public? Something like: @nojavadocs public void foo(){ //... } P.S. I understand the point here about API, but the methods are simply "unsupported." They work (and must be public for access from other packages), but we do...

google calendar java api

Hello, I have an object of CalendarEntry I know that http://www.google.com/calendar/feeds/[email protected]/allcalendars/full is the feed url of all calendars but how I can get this feed url from CalendarEntry instance? Because I wanna post a new entry in a specified calendar and I need this url. Thanks! ...

Similar but not same string sequence

How to match the following sequence: You wound DUMMY TARGET for 100 points of damage but not: You wound DUMMY TARGET with SKILL for 100 points of damage with the regular expression: ^You wound ([\\w\\s]+)(?!with) for (\\d+) points of damage The regular expression above is matching both strings while i expect to match only the fi...

ServletRequest.getParameterMap() returns Map<String, String[]> and ServletRequest.getParameter() returns String?

Can someone explain to me why ServletRequest.getParameterMap() returns type Map<String, String[]> ServletRequest.getParameter() just returns type String I'm don't understand why the map would ever map to more then one value. TIA. ...

How to split up complex conditions and keep short circuit evaluation?

Sometimes conditions can become quite complex, so for readability I usually split them up and give each component a meaningful name. This defeats short-circuit evaluation however, which can pose a problem. I came up with a wrapper approach, but it is way too verbose in my opinion. Can anybody come up with a neat solution for this? See...

Deploying .war file in Websphere application server 6.1?

When i was trying to install new application in WAS 6.1, I have given the .war file i've created for SampleApplication. The SampleApplication.war is successfully running in Tomcat server, but when i tried to deploy it in WAS 6.1, following error was shown. The exception **IWAE0022E** Exception occurred loading deployment descriptor fo...

Maven-Tomcat-Plugin using configured web.xml errors with FileNotFound after a clean

When attempting to execute mvn tomcat:run right after a clean, and with a configured tomcatWebXml specified in the pom, I get a FileNotFoundException. Here's the snippet from my POM: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.0-beta-1</version> <configuration> ...

Setting the working directory of a Java Applet

Hi, I have two signed Jars, a.jar and b.jar. a.jar is launched as an applet inside the browser and b.jar is in Appdata/locallow/xyz (Vista). a adds b to it's classpath and calls some functions of b.jar. So far so good. Now b unpacks some dlls into the working directory and depends on them. It must be the working directory, because the d...