How to exclude classes from a packaged webapp with maven.
How can I filter certain classes in /target/classes from going into /target/[webapp]/WEB-INF/classes? I want them compiled into /target/classes/ but not in the final war. ...
How can I filter certain classes in /target/classes from going into /target/[webapp]/WEB-INF/classes? I want them compiled into /target/classes/ but not in the final war. ...
How do I prevent String.format("%.2f", doubleValue); from rounding off (round half up algorithm) instead of just truncating it? e.g. doubleValue = 123.459 after formatting, doubleValue = 123.46 I just want to discard the last digit, 123.45 I know there are other ways to do this, I just want to know if this is possible using the...
can some one please tell me how to connect java file to postgresql database (if posible wit code n explanation) ...
I have a string with some markup which looks like this: The quick brown <a href="www.fox.org">fox</a> jumped over the lazy <a href="entry://id=6000009">dog</a> <img src="dog.png" />. I'm trying to strip away everything except the anchor elements with "entry://id=" inside. Thus the desired output from the above example would be: The qu...
Hi, I'm trying to do a remote call to remote object running as part of a application installed in Websphere. The end solution will be RPG to local java cilent to call remote service that calls the webservice. This mainly so we have one set of code to call the webservice and doing the xml parsing, plus the iSeries doesn't have direct ac...
I am a long time java developer on JBoss(and Tomcat). In the last year I had to develop over weblogic and I have to say - I really miss JBoss. Since my experience with weblogic is pretty shallow, I am asking the more experienced guys out there: Is there a reason for spending money on weblogic? Isn't JBoss giving you all that you need...
I have a Java application with three threads that open, each, a socket and connect to a server on different ports. I set so_timeout on each of these sockets after the connection to the server is established. After that the threads block waiting on read(). Only one of the threads times out after 20 seconds (which is the timeout I set). Th...
Hello guys, I am trying to learn how to implement Web Services using Axis2 and Tomcat, but i'm afraid that i'm not grasping some of the basics. I was following this tutorial but when i attempted to use WSDL2Java i noticed that i do not have the tool anywhere. This happens due to the fact that i downloaded and installed the .war (web ar...
Cans someone point in the write direction for printing barcode labels using Java? I can use the barbecue library (http://barbecue.sourceforge.net/) to generate them bar codes as images, but I need a way to put the image (and human readable caption) into an Avery document template for printing. ...
I have data model classes that contain private fields which are meant to be read-only (via a getter function). These fields are set by my JPA persistence provider (eclipselink) during normal operation, using the contents of the database. For unit tests, I want to set them to fake values from a mockup of the persistence layer. How can I d...
Reading around Nokia forums, It seems that accessing Cell-ID and related info from Nokia S40 series phones is virtually impossible unless your Midlet is signed, and even this would work only for S40 3rd Edition FP1 and above. I tried the following on a Nokia S40 Dev Platform 2 phone , using Java ME: System.getProperty("com.nokia.mid.ce...
I need to customize the SSL handshaking when calling a JAX-WS API on top of Axis2. I find no reference at all on how to do this. With Metro I can set a custom SSLSocketFactory, but that uses a non standard API. How do I get access to the Axis engine so that I can reconfigure it before sending a soap request ? ...
A quick Google didn't turn up a definitive answer. If URI does do this, is there a widespread third-party library that won't do this? I just need some parsing, and I can't have unpredictable delays while the constructor attempts to resolve a URI? Thanks. ...
Explanation: I have a JSF command link that sets a member in the backing bean, however, when setting the backing bean member using setPropertyActionListener I get a tag not recognized error. The project builds and deploys with no issues. The default page is displayed then the error is thrown on the page request with the setPropertyAct...
I am trying to make a Java application thread-safe. Unfortunately, it was originally designed for a single-user mode and all the key classes are instantiated as singletons. To make matters worse, there is a whole bunch of interfaces working as constants containers and numerous static fields. What would be considered as a good practice in...
Generating a truly random string of a given length is a fairly straightforward (and already-well-covered) task. However; I'd like to generate a "pseudo" random string with the additional constraint that it be relatively easily readable (to a native-English reader.) I think another way to say this is to say that the generated string sho...
I've gone through the process on this page to expose the JMX interface of a web application. I've managed to view the exposed interface on the Tomcat JMX proxy but when I load JConsole and look for the exposed mbean interface I can't find anything related to the attributes and operations exposed. Thre is no specific entry on jconsole ...
I have a factory method that creates objects to be used in unit tests. These objects all derive from the same base class: public static <T extends BaseEntity> T modMake(Class<T> clazz) { try { return clazz.newInstance(); } catch (InstantiationException e) { // Should never happen throw new AssertionError(...
I have inherited some Java code that does some testing of our XMLRPC server. So far so good. Part of that code deals with stopping the server (a few repetitions of "check if server still there and if so send it command to shut down"). As the server is shutting down, some of these "is the server still there?" and/or "tell it to shut dow...
I have a simple Desktop Facebook application that allows the user to retrieve some of their Facebook info(Written in Java). This info is then sent to their phone. When the user sees something of interest (e.g. new comment) in their phone's 'facebook-viewer' (JavaME) they can click to launch a browser and go to 'facebook.com' to view it...