java

eclipse tomcat debug mode slow - pegs cpu

Running Tomcat through eclipse works fine in non-debug mode, but not in debug mode. When I try to start the Tomcat server in debug mode, the console output looks fine for a while, but then starts slowing down and eventually just stops, pegging the cpu at 100%. I don't think it's relevant, but just in case - here's the console output ri...

Java : compress image without fully load them

I'm creating an applet that send pictures to a servlet. The applet first action is to resize and compress the picture. I'm using ImageIO to load the picture into a BufferedImage. Next I resize the picture and then use ImageWriter to compress it in jpeg. That's work fine. The problem is when the user send a very big pic(up to 70MP). Th...

How to get HTTP response through socket in java?

I have written a code to send a HTTP request through a socket in java. Now I want to get the HTTP response that was sent by the server to which I sent HTTP request. ...

.action extension... what is it?

I've never come across this extension before. It's being used for a front-end interface to a j2ee backend. ...

JBoss 4.2.2 web service soap:address

I have an EJB3 bean deployed as a web service in JBoss 4.2.2. In production the server is behind an Apache server that redirects requests to the Jboss server. This makes the WSDL have the wrong soap:address location. I was able to get the port and host name changed via the configuration file in server\default\deploy\jbossws.sar\jbossws.b...

Uber basic java question

How do i read a char from a user in the command line. I am familiar wit readInt() is there some thing like this for chars. please help this is for the stanford course i am taking online as part of stanford engineering everywhere over the summer and i need to finish soon before my high school term starts. Is there any way I can do thi...

How to test JSP TagExtraInfo ?

I consistently have troubles getting my TagExtraInfo implementations to work properly. I have one implementation that works, and one that doesn't and I unable to see the difference between the two. And all the IDE's seem to have have "bugs/features" regarding this, which makes it hard to see where the problem actually is. The relationsh...

Eclipse fails to start via an application launcher

Hi everybody. The problem: elcipse-3.5.0 (Galileo) spits with an error when I try to launch it by clicking its launcher. The curse sound like this: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following location...

Implementing the "system" command in Java.

I have need for a "system" function call, the same as those in Python, Perl, PHP, Ruby, &c. It will be a component of a JavaScript standard library called Narwhal, when it's run on the Rhino JavaScript engine, which is in turn run on Java. The trouble is that Java's standard library appears to have abstracted away the ability to spawn ...

Need easy way to force all DynaBean property names to lower case

I'm developing functionality that can operate on concrete data beans returned via Hibernate, or DynaBeans returned by using Jakarta Commons/BeanUtils' RowSetDynaClass (which wraps a JDBC result set). RowSetDynaClass by default forces all bean property names to lower case, and I need to convert all my concrete beans from Hibernate to Dyn...

java browser using mozilla webclient

Hi, I have downloaded the xulrunner.zip and webclient_2_0_a9_rc3.zip . Can some one explain me through a simple code of JAVA so that mozilla webclient will call any web page. I want to call a we page in a jframe.A simple demo that implement calling of web page in jframe using mozilla web client. Please help.I just need to know how to i...

How to present wave form in Java

Hi all, I've got this small code that performs recording in java. I whish to add some sort of functionality to draw a visual presentation of this. How would you advise me to approach this? (I am very new to java ) I'd like the visual presentation to appear as a foreground of a current existing image. ...

What's the best way to handle this "try - error - clean -retry" case?

I am trying to load an image in memory but might have memory issues since i have some other images loaded. These images have a "visible" field that dictates whether they are visible or not. Regardless of the visibility i keep them in memory for fast loading (when they become visible again). But since i have many of them in memory i wan...

Can I use thread.stop () in Java if I really need it?

I need to use deprecated stop () because I need to run Runnable classes which were developed by other programmers and I can't use while (isRunning == true) inside method run. The question is: Is it safety enough to use method stop ()? Theads don't work with any resources (like files, DB, or Internet connections). But I want to be sure t...

When I persist, the entity doesn't show up in the list view.

I'm trying to add a new entity and then after a successful commit, redirect them to the list action. Here's a summary of what I'm doing: @Name("offerAction") @Scope(ScopeType.CONVERSATION) public class OfferAction implements Serializable { @In private EntityManager entityManager; private List<OfferSite> offerSites; @Factory("off...

how to add the servlet api to my pom.xml

How do I add the servlets API to my project's pom.xml mvnrepository.com has lots of servlet api and similarly named projects, that I don't know which is the right one. Or are all of them ok? ...

How do I write an uploaded file from ejb3 app to Oracle directory.

I'm going to analize some Excel files that the user has to upload in my webapp, I already have the stored procedures that works. But i have no idea how to save the uploaded file to my oracle directoy. I think there are two steps, first creating the file into the specified path. And filling tha file with the info. If somebody has made thi...

Excract JPanel into new class in NetBeans

This is similar to this question, except the code is already written. I have JFrame JTabbedPane JPanel X <...> JPanel Y <...> JPanel Z <...> all defined in the same class, but I want to move each panel into its own .java file. I really don't want to manually copy-paste from the underlying .form and .j...

java: is else necessary after if else if statements?

I thought else at the end of if{} else if{} else if{} is not necessary in java but unless I put it in the code does not work. why is this? ...

Eclipse - debugger doesn't stop at breakpoint

I am trying to trouble shoot a JUnit. In the source code, I have set break point in two places: 1) in a line where a static member is initialized 2) the first line of one of the test cases. The debugger stops in the static field initializing line. But it doesn't stop in the test case. No matter where I set the break point in the test ca...