java

Error while launching soapUi 3.01

soapui.bat Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cl i/CommandLineParser Where can I find this library? I already put JAVA HOME to my sdk and I am using windows XP. Any ideas how I can resolve this? ...

Struts - Passing parameters between action

I have got two actions - ActionA and ActionB, Im trying to invoke ActionB from the result of ActionA using 'action' tag in the following way <s:action namespace="/myNameSpace" name="actionB" executeResult="true"> <s:param name="param1" value="Value1"/></s:action> The tag is invoking 'actionB' and Im getting the result from ActionB ...

UI: Month selector

For my UI, I need a month selector (i.e. not a day but "what happened in August 2008"). Has anyone seen such an UI element? Obviously, I'm looking for more than two combo boxes (one for the months and one for the year). What I want to know if someone has encountered a cool month selector. :) ...

javac complains: cannot find symbol on enum implementing interface

I have three java types as defined below: Main.java: import java.util.Arrays; import java.util.List; public class Main { private Object callFunction() { OperationDefinitions func = OperationDefinitions.CONCATENATE; List<Object> values = Arrays.asList(new Object[] {"ABC", "-", "DEF"}); return func.call (values)...

Tomcat Logging while running as a windows service

I have a web application running under Tomcat. Logging for various features is implemented using java.util.logging. When running tomcat via startup.bat the logging files are created and record the logging as expected. When running as a windows service using the same war file the output from logging is virtually absent. There is some (...

Running multiple sites from one web application in Java

I'm thinking something in lines of drupal multisite, where every site should have it's folder with themes, plugins and various static files. It turns out it's not quite easy to do with Java: classes must be in one place, tag files in other, static files in third, only jsp files can go wherever. classes and tags can be packed in jars, but...

disable java log rotation

I use java.util.logging.Logger to log in my app : FileHandler fh=new FileHandler(this.todayFileName, 0, 1, true); fh.setFormatter(new SimpleFormatter()); Logger.getLogger(rootLogger.getName()).setLevel(Level.ALL); Logger.getLogger(rootLogger.getName()).addHandler(fh); but this does work well except that log rotation...

What is the proper way to package a single jar file as rpm?

Hi I have created my jar file now i want to package my jar file as rpm(redhat package manager). I want to make my jar file as installable for linux. so What is the proper way to package a single jar file as rpm? Thanks Sunil Kumar Sahoo ...

Why is list.size()>0 slower than list.isEmpty() in Java?

Why is list.size()>0 slower than list.isEmpty() in Java? On other words why isEmpty() is preferable over size()>0? When I look at the implementation in ArrayList, then it looks like the speed should be the same: ArrayList.size() /** * Returns the number of elements in this list. * * @return the number of elements in...

JDBC Timestamp & Date GMT issues

I have a JDBC Date column, which if a i use getDate is get the 'date' part only 02 Oct 2009 but if i use getTimestamp i get the full 'date' 02 Oct 2009 13:56:78:890. This is excatly what i want. However the 'date' returned by getTimestamp 'ignores' the GMT values, suppose date; 02 Oct 2009 13:56:78:890, i end up getting 02 Oct 2009 15:5...

Apache tiles converts open tag and close tag with no content to an empty tag.

Apache tiles converts open tag and close tag with no content to an empty tag. For example <script src="some.js"></script> will be written as <script src="some.js"/>, which breaks my HTML. How to prevent this behaviour? ...

Creating valid filenames in Java

I am creating filenames based on dynamic values such as company name and forename/surname. I would then like to verify that the filename is valid before attempting to create the file. That is check it doesn't contain any illegal characters, and replace them if they do. I could of course just use a regular expression, but was wonde...

Calculating a month as a "between" period in java

I want to select records that have a created date between the first and the last day of a given month. I calculate the month with begin and enddate the following way: The Date "month" is just a random date inside the timeframe Calendar cal = Calendar.getInstance(); cal.setTime(month); int endday = cal.getActualMaximum(Calendar.DAY_OF_M...

How would you intercept all Exceptions?

What is according to you the simplest way to intercept all exceptions in a Java application? Would AOP be needed to provide this kind of functionality or can it be done with dynamic proxies or is there another way? Is the simplest solution also a good solution regarding impact on execution performance? I would like to hear possible solut...

how to get the one entry from hashmap without iterating

Is there a elegant way of obtaining only one Entry<K,V> from HashMap, without iterating, if key is not known. As order of entry of entry is not important, can we say something like hashMapObject.get(zeroth_index); Although I am aware that there exist no such get by index method. If I tried approach mentioned below, it would still ha...

Eclipse plugin: NoClassDefFoundError on org/eclipse/jdt/ui/JavaUI

I am creating a plugin which requires jdt.ui.JavaUI class. I included the jdt.ui plugin into the dependencies. This is my Manifest.MF: Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: PanelGenerator Plug-in Bundle-SymbolicName: PanelGeneratorPlugin; singleton:=true Bundle-Version: 0.1.0 Bundle-Activator: panelgenerator.plugi...

How to patch a subcomponent in a maven-managed framework?

I need to patch the mule-transport-jms subcomponent of mule for this bug (http://www.mulesoft.org/jira/browse/MULE-3983). The "fix" is straightforward but what is vexing me is deploying the patched component to my local maven repo (managed by Nexus) and having it continue to play nicely with all the other components of mule. What I w...

Good blogs about multi-threaded development?

About a year ago I read the book "Java concurrency in practice" and I learned a lot from it. I was wondering if there are any blogs about multi-threaded development in Java, since many topics discussed in blogs are not covered in books. If this blog also contains techniques about testing thread-safety it would be great, but any blog abo...

Check valid enum values before using enum

I'm trying to lookup against an Enum set, knowing that there will often be a non-match which throws an exception: I would like to check the value exists before performing the lookup to avoid the exceptions. My enum looks something like this: public enum Fruit { APPLE("apple"), ORANGE("orange"); ; private final String fruitname...

Setting up Dev environment for Java development (Q.1)

Hi, 1st part Never worked on team who uses different IDE for one project.. (But our team right now does that) Never tweaked Ant Script of IDE, or wrote any Ant script.. I am Netbeans user, (since last 2 years) and ultimately want to become independent of IDEs (except for coding and code completion) .. like deploying, building So I ...