java

how to distribute java desktop application ?

which is the alternate to distribute java .. i dont want to add jre in my extracted files i dont want to give away my .jar file to user end user just install and use application.. which dbms to use so that user dont need to configure like MSSQL needs configuration of server. how to decrease execute time of my application it takes ...

Java Enums: Two enum types, each containing references to each other?

Is there a way to get around the class-loading issues caused by having two enums that reference each other? I have two sets of enumerations, Foo and Bar, defined like so: public class EnumTest { public enum Foo { A(Bar.Alpha), B(Bar.Delta), C(Bar.Alpha); private Foo(Bar b) { this.b = b; } public final...

Gracefuly stop .net initiated Java Process

Having the next .net code, I want to stop it correctly so that the jvm executes it's ShutdownHooks. System.Diagnostics.Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardError = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.StartInfo.Worki...

How to direct subdomains to the correct JBoss App?

Hi, new to JBoss and am configuring some applications. I know how to do this in apache webserver, but not using Jboss. I have successfully deployed 3 applications on a redhat box, JBoss 4.2. If my server is called fruit.mycompany.com, I can access the three apps this way: http://fruit.mycompany.com:8080/quince http://fruit.mycompany....

log4j: one class; same level; two output files

I don't seem to be getting any INFO level messages into Additions.log or Deletions.log even though I see the logging line get executed in the debugger. Here is my log4j.properties file: log4j.file.home=. log4j.rootLogger=INFO, dest1 log4j.rootCategory=INFO, dest1 log4j.logger.org.hibernate=ERROR log4j.category.dest1=INFO log4j.append...

How to use virtual memory (swap in linux file system ) in java web programming

I work in java web application . In some section i use very huge tree variable that save and persist in memory (RAM) . Can i migrate this to virtual memory (swap) . note : huge tree consist name and email for all user that use in suggestion Ajax text-box . ...

Can I force JAXB not to convert " into ", for example, when marshalling to XML?

I have an Object that is being marshalled to XML using JAXB. One element contains a String that includes quotes ("). The resulting XML has " where the " existed. Even though this is normally preferred, I need my output to match a legacy system. How do I force JAXB to NOT convert the HTML entities? -- Thank you for the replies....

Log4J - how to log an exception caught in an imported library?

I am a pretty new user of Log4J v. 1.2.15, as a friend of mine convinced me of the advantages over console or other forms of logging. However, as i was doing some tests, i've encountered a test case that got me thinking. Here it is what i did : I've configured the properties, added 2 appenders, a ConsoleAppender and a RollingFileAppen...

How to trigger a hyperlink using a keystroke in a Swing JEditorPane

Hi all, I'm trying to fire hyperlinks in a JEditorPane using the "Enter" keystroke. So that the hyperlink (if any) under the caret will fire rather than having to click with the mouse. Any help would be appreciated. ...

Weird java.io.IOException: Server returned HTTP response code: 503 for URL

I am writing a servlet jsp under Glassfish to download a file from a website, do some processing and display the result in webpage. When I deploy the servlet, it gave me: java.io.IOException: Server returned HTTP response code: 503 for URL: www.websitename.com error. I check the status code 503 out and it turns out to be a server ove...

On Performance and Java Interoperability: Clojure vs. Scala

I have already read various accounts of Clojure vs. Scala and while I realize that both have their place. There are a few considerations that I haven't acquired a complete explanation on when it comes to comparing both Clojure with Scala: 1.) Which of the two languages is generally faster? I realize that this will vary from one langua...

What are the pros and cons of using GroovyClassLoader vs. GroovyShell

I need to run some external code from my Java application that will be updated frequently and orthogonally to the rest of the application. As I do not to re-deploy the entire application for every code change (and for other reasons as well) we chose to use groovy for this code, and store it either on the file system or in the database. ...

On String creation for queries in Hibernate and whether those queries would reduce object creation if they were final static

Given this Hibernate snippet @org.hibernate.annotations.NamedQueries({ @org.hibernate.annotations.NamedQuery( name = "ASSIGNED_CONTINGENCIES", query = "select ctg.id from Cont ctg join ctg.labels cl where cl.id = :label_id and ctg.datasetId = tscommon.rdsidtodsid(:datasetting_id)...." ) }) Does it mean that eve...

What is the look and feel of Violet UML Editor

I was wondering what was the look and feel used in the java application Violet UML Editor. It seem it name is "Blue Vista" but I can't find it on google. Pictures : ...

Aggregation: Life after death or no?

I have been reading a couple of articles on stack overflow about aggreation and how it compares to delegation and composition. Mainly: http://stackoverflow.com/questions/1384426/distinguishing-between-delegation-composition-and-aggregation-java-oo-design According to this and other articles I have read on here, the concession is that a...

Create Runnable JAR with .properties files using Java Eclipse

Hi, I'm trying to build a runnable JAR using Eclipse's Export function. everything works fine except several .properties files I have under the root directory. I added all the .properties files into Build Path, and they appears under 'Order and Export' tab in Java Build Path dialog. However, when I try to run the Export, I got the foll...

What's PHP Equivalent of Java Servlet Filter?

On Java side, we have a servlet filter that handles authentication. We don't have to change all other servlet or JSPs to add authentication to the page, unless the page needs customized content. How can we achieve the same on PHP? We don't use any frameworks on PHP. ...

Atlassian JIRA Plugin Development: How to make variables available to velocity templates

FAIR WARNING: this question is going to be pretty tough to answer unless you have experience with JIRA and have access to their source (enterprise users). Greetings all, I am writing a plugin which extends AbstractIssueSelectAction. I noticed that ${issue.summary}, etc are all available from within my velocity template, however, there...

Debugging breakpoints on JUnit test in Eclipse are not working

I am trying to debug a junit test in eclipse but my breakpoints are not firing (unless they are on the first or second line). I've tried deleting and recreating all breakpoints in the workspace, cleaning the project, creating a new debug configuration, and running the test method individually and as part of a test class with other metho...

Java, Get Class object for containing class, Not Runtime Class

Consider this Java code class A{ //@returns Class object this method is contained in // should be A in this case public Class<?> f() { return getClass(); } } class B extends A {} B b = new B(); System.out.println(b.f()); //output -- B.class (Wrong, should be A.class) inside f() i can't use getClass() because that will give m...