java

Is there any reason to write terse code in Java/C#/C++?

Did you ever find yourself writing terse code in Java, C# or C++? If so, why? Do you think there are any situations in which this should be acceptable, given the situations in which these languages are used? ...

Can anyone help with a Java problem?

I have this code and for some reason I can't get it to work? Can anyone see the problem? I need this data to be able to return all the records that contain the same name that is entered in the mNameSearchDelete textbox. however no records are returned which should be there. thank you protected void searchForNameToDelete() { carry...

Adding JMS Info breaks EhCache

I want to distribute my EhCache via a JMS Topic. This is documented here on EhCache's site I'm using: ehcache-1.6.0-beta3 ehcache-jmsreplication-0.3 spring-2.5 spring-modules-0.9 My Spring config looks like this: <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> </bean> <bean id=...

Have you found success with a Spring and Hibernate Web Application

I am working on medium sized web application 4-5 tabs, user login for about 100k users. We are completing redesigning the application from scratch and using spring and hibernate, connected to MySQL. Did you experience major issues and what where did Spring benefit your application. ...

Show the CMD window with Java

I'm using this code to launch a .cmd file: try { String line; Process p = Runtime.getRuntime().exec(myPath + "\\punchRender.cmd"); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { ...

How to get Eclipse tools working nicely with JSP?

How do you get Eclipse to work properly with JSP files as it does with Java files? Specifically: Eclipse "Find references" (Right click on method, references, workspace) doesn't find references in JSP files. Eclipse refactoring (Right click on method, refactor, rename) doesn't rename references in JSP files. We're using Eclipse 3.2...

Web Charting, serverside or client side?

I'm trying to establish whether we are better off rendering charts serverside and pushing them to the browser as images or using a javascript charting library to draw the charts clientside. I'm looking at the JFreeChart and Dojo Charting libraries, my target is an existing JSP site that runs in JBoss. Does anyone have any experience wi...

Selenium Java process called from c# not starting properly on CCNET build server

Hi, I'm setting up CCNET server to run Selenium tests. In my test code I use the following to start the Selenium RC server if its not running: var proc = new Process(); proc.StartInfo.WorkingDirectory = Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, @"..\..\..\..\..\lib\SeleniumRC\selenium-server-1....

Why does JAXB 2.0 with jdk1.5 fail to recognize string enumerations that start with a numeral?

Following is the sample schema I used to try to generate the JAXB classes. What I noticed is that when I have a string type with enumerations, for instance, in my case the stepType, with values starting with a numeral, JAXB does not generate a separate enum class say StepType class. It works fine, when I use only alphabets for the valu...

Multiple questions in Java (Validating URLs, adding applications to startup, etc.)

I have an application to build in Java, and I've got some questions to put. Is there some way to know if one URL of a webpage is real? The user enters the URL and I have to test if it's real, or not. How can I konw if one webpage has changes since one date, or what is the date of the last update? In java how can I put an application r...

GWT Textbox Encoding and RPC

Let's say I have a TextBox and the user puts some data in it. I then send the data over RPC, with something like this (synchronous version of interface) public void submitText(String userData) { dao.saveText(userData); } My questions are: What is the encoding of the userData? This is a trick question, since Strings in java are sto...

How to get MigLayout to work with my project?

I'm trying to make a small GUI app and I want to use MigLayout with it. As Java newbie I don't know how to get MigLayout to work with my code and I'm running out of ideas. My project source code is in ~/git/project/src/qdb/ The qdb is my java package name. I downloaded miglayout-3.7-swing.jar and miglayout-3.7.jar and placed them to m...

What is the cause of EJB 2.x "reentrant method call detected" Exceptions? How to solve them?

Hi all, I'm mantaining a EJB 2 CMP legacy app runing on a JBoss 4.0.4 GA application server with deployed entity/stateless session beans. All the EJB boilerplate code is generated via XDoclet from the EntityEJB/EntityEJBManager annotations. I've noticed that when my GUI client invokes the facade create method, I have lots of cases of E...

Looking for a generic library for interacting with a JPA model

I'm building an application using a JPA object model, and creating several Data Access Objects to interact with that model. I'm finding that I'm repeating a lot of code (essentially CRUD) between different Data Access Objects. The only thing that differs are the targeted JPA classes. I was wondering if anybody knows of an abstraction li...

Center a drawn string relative to the window size?

I'm trying to center a string drawn with a ""system", Font.BOLD, 90" font in Java. I've tried (width/2 - (font.size/2 * num_of_chars)) but that didn't work. g2d.setFont(new Font("system", Font.BOLD, 90)); g2d.drawString("Pause", (int) ((800/2) - ((Font.getSize()/2) * 5)),270); ...

Serializing is not storing object data, only object references

I have a node tree built out of Node objects. They are more complex than the code I am showing but only have primitive or Serializable instance members. Assuming each Node can have up to 10 children the code looks a bit like so. public class Node implements Serializable{ private static final long serialVersionUID = -84892621809022...

What is the purpose of interfaces?

I want to understand the purpose of interfaces. I know how to declare an interface and how to implement the interface, but what is the need of it? I need to understand the reason for using interfaces. In every programming course, the teacher has said, "It is a contract. It has just definitions of methods and properties," and given an exa...

How to detect user activity with a Java service running on Windows?

My goal is to create a system monitoring application using Java. I would like to know when a user is doing activity on a Windows PC. The result would be something like this: 8:00 - 8:15 activity 9:12 - 10:29 activity 12:24 - 15:34 activity I'm not interested in any other information (which key was pressed, application used, etc.). On...

Why does autoReconnect=true not seem to work?

I am using JDBC to connect to a MySQL server (no connection pooling I think). In the connection URL I have autoReconnect=true But my connection still times out. I've even checked conn.isClosed() and its false. But when I try to use the connection I get the following exception. com.mysql.jdbc.CommunicationsException: Communications ...

Learning Trail for Java Web Development?

I've Inheritted a large Java Web project which I've got to make some modifications to, I'm a fairly competent Java Programmer when it comes the the basics but I've never done any JSP programming or EJB programming before. I remember vauguely doing some servlet programming 5 or so years ago in university, but I'm assuming that everything...