java

How do I create a unique ID in Java?

Hi, I'm looking for the best way to create a unique ID as a String in Java. Any guidance appreciated, thanks. I should mention I'm using Java 5. ...

Spring load time weaving not detecting class annotated with @configurable

I'm having trouble getting AspectJ to perform load time weaving on a class annotated with @configurable in my main project. No fields get set and none of the setters are touched. I don't think there's trouble with the configuration itself, because I've extracted the configuration and tested it on a smaller sandbox project. Just for the...

Java - writeLong method of DataOutputStream and writing hex

Currently, I have: outByte.writeInt(0x49492a00); outByte.writeInt(0x08000000); But i want to be able to write all of that on the same line. But: outByte.writeLong(0x49492a0008000000) is underlined red in Eclipse, and therefore incorrect. Is it possible to write those two lines all in one with writeLong()? ...

applet-server communication, how i can do it?

hi i have an applet and i must request to a web application to get data from server that is in database,i am workin with objects and it is very useful that server response me as objects !! how an applet can communcate with server? i think web services methode, RMI and... make me happy, but wich is the best and reliable? ...

Is there a way to get a timeZone with (only) a country code (valid ISO-3166 code) ?

Hi everybody, I'm trying to get a TimeZone for a user. For this I have a country code which is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as: http://www.chemie.fu-berlin.de/diverse/doc/ISO%5F3166.html I think th...

Antivirus (Symantec Endpoint) configuration for developer machine

What are your "Symantec Endpoint" configuration recommendations for a developer PC? We do java development with Eclipse, IntelliJ, Ant and Tomcat. With "Symantec Endpoint" the build and server startup are quite slow. Replacing or removing Symantec is not an option. See also http://stackoverflow.com/questions/111226/least-intrusive-antiv...

Delete a hibernate entity with tapestry5 gives : "a different object with the same identifier value was already associated with the session"

I have an error being thrown on deleting an entity. I have users in only one group at a time, so it's a ManyToOne relationship on the User class. In the page class I have a property group: @Property @Persist private Group group; that is populated on page activation: public void onActivate(Group g) { group = g; } When the dele...

How do I check if a Socket is currently connected in Java?

Hi, I'm trying to find out whether a Java TCP Socket is currently connected, the following just seems to tell me whether the socket has been connected at some point - not whether it is currently still connected. socket.isConnected(); Any help appreciated, thanks. ...

How to express inter project dependencies in Eclipse PDE

I am looking for the best practice of handling inter project dependencies between mixed project types where some of the projects are eclipse plug-in/OSGI bundle projects (an RCP application) and others are just plain old java projects (web services modules). Few of the eclipse plug-ins have dependencies on Java projects. My problem is t...

Hotfixing Code running inside Web Container with Groovy

I have a webapp running that has a bug. I know how to fix it in the sources. However I cannot redeploy the app as I would have to take it offline to do so. (At least not right now). I now want to fix the code "at runtime". Surgery on the living object, so to speak. The app is implemented in Java and is build on top of Seam. I have add...

DB that works with Win 98 and Java?

I'm trying to write a small accounting app, mainly for my dad's use. His PC is running Windows 98 (and upgrading is pretty much out of the question due to technical concerns as well as logistics). Java 4 and 5 still seem to work with Windows 98, but I'm totally lost about the DB part. Does anybody know a good, up-to-date database that in...

best practice: how to host server-side code in the maven repository

What is the best way to put javascript/html/css code in the maven repository, so that is easily usable by java projects. Is there a way to do it such that the included project can be easily made "web-visible" by the including project? For example assume I write a very useful tricks.js file an put it in the mvn repository. Is it possib...

Running multiple Btrace scripts

Do anyone know how to run multiple btrace scripts at the same time? I dont want to pre compile and start my program with them. I want plug into the running process with multiple btrace scripts. ...

Tomcat: hot deploying new jars

Can you hot deploy JAR files on Tomcat 5? The idea is to avoid restarting Tomcat and still be able to load (via reflection) some class from a newly added JAR. Can it be done? How? Is it unadvisable for a production system? Thanks Edit: my scenario requires the addition of new JAR files for which the names aren't known in advance. Can t...

Best view layer with simple URLs for an EJB3 application

Hi. I would like to get your input on what would be the most fitting view layer for EJB 3.0 [1] Java application for me. JSF is no good because it is a mess when it comes to web URIs. I would like a view framework which would help with automating html form submission and validation while using clean URIs like example.com/story/1 or exam...

Should I use Eclipse plug-ins (or OSGi Bundles) as a plain dependency management tool?

Heya, once again it has happened... I joined a new project, composed of several plain Eclipse Java Projects, with interdependencies, all managed through the Project build path. I find this all a bit of a chaos. And when it comes to run configurations - you just enter hell. In the past I've sticked to create plug-in projects, instead of...

Hibernate - Get all entites created in a cascading create

Hi all If I have an entity with a parent / child relationship (and Cascade=CascadeType.ALL), and call: getSession().save(parent) the primary key of the parent is returned. Is there a way to access the primary key of the created child? Regards Marty ...

Java: Check if file is already open

I need to write a custom batch File renamer. I've got the bulk of it done except I can't figure out how to check if a file is already open. I'm just using the java.io.File package and there is a canWrite() method but that doesn't seem to test if the file is in use by another program. Any ideas on how I can make this work? ...

c++ developers which java framework do you like to see in c++

as c++ developer and java developer i always was fascinating from the solutions that java have to offer to any problem as framework that you just drop to your class path and walla.. you can work with it . what are the frameworks do you wish was ported from java to c++ ? ...

Calling a web service from Oracle (10g) stored procedure

Hi All. Can anybody point me out on working example of calling web service (e.g. CXF based) from Oracle 10g stored procedure. ...