java

How to create an object from a string in Java (how to eval a string)?

I know eval is "evil", but I'm using it in a way that the user can't ever abuse it. Let's say I've got a string "new Integer(5)". I want to do something such that I can set a variable, let's say foo, to new Integer(5). Something like Integer foo; String bar = "new Integer(5)" *magic happens* System.out.println(foo) -> 5 I've looked ...

How to Configuring ConnectionFactory JMS on JBossAS5?

Hi Friends.. :) This is the first my question in this forum.. :) please help me about how to configuring JMS ConnectionFactory on JBossAS5.. i have created a simple MDB application : @MessageDriven(name = "MessageMDBSample", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms...

Maven for other languages?

I am relatively new to the world of Java and Maven, but I couldn't imagine starting a new Java project without using Maven. The idea of providing a human-readable project model is something that I would imagine is universally desirable across many languages. This is especially true when your application relies upon numerous external lib...

Java's keytool command with IP addresses

I'm trying to get an image via an https URL, and am having some problems. I generate a keystore with Java's keytool command. If I specify the common name (CN) equal to my hostname, such as CN=JONMORRA, and then try to query via my hostname, such as https://JONMORRA:8443/ then it works fine. However, if I specify the common name as my ...

Recommend PHP or Java Opensource E-Commerce solution

A friend of mine was about to be scammed by a bunch of pseudo-programers that intended to sell him a opensource shopping cart as if it was developed by them. Luckly he was smart enough to ask his geek friends first. Now I'm committed to help him with this endeavor. But to be honest Im more into custom software development that into impl...

How do I make use of java library?

My project is to develop a network analysis tool and I decided to use JUNG library. but I don't know how to get started and make use of it?I'm using eclipse IDE so how can I intergrate it in eclipse? thanks. ...

TreeViewer#update(Object element, String[] properties); what do properties refer to?

Hello, I have been wondering about the parameter 'properties' in the method TreeViewer#update(Object element, String[] properties). What are they? What do they refer to? I am not sure what goes into the String[] - are there predefined constants to use? Or are these the names of my column headers? Something else? I couldn't find any e...

ClassNotFoundException for com.bea.content.manager.internal.ContentUpgradeListener when attempting to start application in Weblogic 10.2

I'm getting the following error when attempting to move an application from a state of "Prepared" to "Active": weblogic.management.DeploymentException: at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:171) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(A...

Is using AD credentials entered into form fields as opposed to the browser integrated auth window bad practice?

I’m looking for a bit of feedback on the practice of requesting users to authenticate to an intranet based web app by entering their AD credentials directly in form fields. For example, using domain\username and password fields as opposed to using the native browser based challenge window for integrated authentication. In the form based ...

Is there a particular naming convention for Java methods that throw exceptions?

I'm tempted to add a suffix like "Ex" to differentiate methods (with similar signatures) that throw Exceptions from those that don't. Is there such a convention? ...

Java licensing for commercial distribution

I'm thinking of using Java to write a program that I might try to sell one day. I'm new to Java so I have to ask, what types of tools/software/etc will I need (from development, to distribution, to user-friendly installation on users' machines) that have licenses that must be considered to make sure they allow sales and closed source co...

Ext-GWT Advanced Form

I'm attempting to use the advanced forms of Ext-GWT, but the provided example is only shows how to lay out the form, not submit or process data. Are there any end to end examples of how to use these? I'm attempting to make a form that has text and a file upload, but I have no idea how to do anything beyond what is provided out in the exa...

Would it be accurate to say that JAXB is to XML as Hibernate is to a database schema?

If I want an ORM that helps me to develop a "database agnostic" application, then Hibernate would be a good fit, but if I need to map entities or objects to nodes in an XML file, then JAXB would be the right type of technology... would that be a correct assessment? ...

Directed notifyAll()

Hi Guys, A question if I may. Lets suppose that my main thread creates 3 threads. These 3 threads call wait() on a certain object. Then the main thread calls notifyAll() for the same object. How can I ensure than thread2, and only thread2, proceeds while thread1 and thread3 simply ignore the notification and go back to waiting state? ...

read a int from a file wrote by java's writeInt method in C++?

How would one go about doing this? Also, is there an easy way to do it? Using a lib like Boost or something? ...

java Generics legacy compitability problem

this code compiles fine and when executed produce "004b" how that happen why it do not produce an classcastException. public static void append(List list) { list.add("004b"); } public static void main(String[] args) { List<Integer> intList = new ArrayList<Integer>(); append(intList); System.out.println(intList.get(0)); ...

How to configure behavior of the "assign parameter to new field" quickfix in eclipse?

I love Eclipse's quickfixes. I use the "assign parameter to new field" often, but I would very much like to tweak it to not include the final keyword. (GWT RPC doesn't serialize final fields, and I am doing lots of GWT RPC right now.) I have not been able to find a setting that controls this quickfix. Is there a setting I am missing...

Ruby code to JAR

Hi, I'd like to be able to compile a ruby program to a java JAR program. I've looked into JRuby and seen several examples of Java applications that would be able to eval() ruby code, but is there a more elegant solution allowing to simply code everything in ruby and then compile the lot directly to a JAR file? The overall goal behind t...

Validation of TSV file in Java

I make a web application to upload a tsv file JDK -> 1.4 Struts -> 1 Resin -> 3.0.9 TSV file parsed with "\t","\n","\r" Validation is.  1. Is the file name along a naming convention?  2. Is it TSV file? How should I do validation of a picture or Office document similar to TSV? ...

Java TCP socket: data transfer is slow

I set up a server with a ServerSocket, connect to it with a client machine. They're directly networked through a switch and the ping time is <1ms. Now, I try to push a "lot" of data from the client to the server through the socket's output stream. It takes 23 minutes to transfer 0.6Gb. I can push a much larger file in seconds via scp...