Hello,
I have a problem. I need to host many (tens, hundreds) of small identical JAVA web applications that have different loads during one time. I want to use Glassfish V3. Do I need to use a load balancer and clusters or something else? Advise where can I find information about similar problems and their solutions...
Best regards,
Alexey.
I have an application where I need to check for a file which may be created dynamically during my execution, I will give up after some MAX time where the file has yet to show up. I wanted to know if there was a more efficient method in Java of checking for the file other than polling for it and then sleeping every X seconds? If not what would be the most efficient manner of doing this?
I have multiple Java projects in Eclipse. I would like to reuse some classes in my new project from my old project. What is the best way to do that in Eclipse?
I.e. is it possible to add another "project folder" to the build-path for my new project?
I'm looking for some simple tasks like listing all the running process of a user, or kill a particular process by pid etc. Basic unix process management from Java. Is there a library out there that is relatively mature and documented? I could run a external command from the JVM and then parse the standard output/error but that seems like a lot of work and not robust at all. Any suggestions?
Is it possible to set a default behaviour for custom (non-native) methods/functions in Java?
For example, I would like to change the default "Function" to do a System.out.println("message") whenever called.
So, when a custom method/function is being created:
public String testMethod()
{
//custom code
}
it should execute the newly added default behaviour (in this case the system output), before the custom code is run.
Even if this would be a bad excercise, is it possible? Maybe by extending the function class or something?
Lazy programmer alert. :)
Cassandra stores column values as bytes (Java example). Specifying a LongType comparator compares those bytes as a long. I want the value of a long into a Cassandra-friendly byte[]. How? I poked around for awhile. I think you people can help me faster.
Hi all,
I want to genrate following JSON dataobject using org.json.simple.JSONObject, how to do it in java?
{
friends : [
{
name: 'David',
interests: 'Cooking',
},
{
name: 'Charles',
interests: 'Hiking',
},
{
name: 'Mary',
interests: 'Football',
},
]
}
If code snipet is provided then that will be really helpful!
Regards,
Abhi
Hi,
We have discussion in my job place about question (We use 1 of the php frameworks):
Why program with php frameworks big web application if it can be done better with rubi on rails, python or java?
Please say our opinion
thanks
I want to write a plug-in which tracks the updates to a text file and stores them in a separate file.
Should I first write a simple java program which does this and then try to convert it into a plug-in?
I've created java webservices and clients using Netbeans. However, the clients seem to have the WSDL already 'built-in'.
Is there an easy way of making my client fetch and parse the WSDL code upon execution, so that if the webservice moves to another server, the client is just invoked with a different commandline argument for where to find the webservice?
is there a dictionary i can download for java?
i want to have a program that takes a few random letters and sees if they can be rearanged into a real word by checking them against the dictionary
In Java, an array IS AN Object. My question is... is an Object constructor called when new arrays is being created? We would like to use this fact to instrument Object constructor with some extra bytecode which checks length of array being constructed. Would that work?
Super constructor invocation definition:
[Primary.] [NonWildTypeArguments] super ( ArgumentListopt ) ;
A super constructor call can be prefixed by an Primary expression. Example (taken from JLS):
class Outer {
class Inner{ }
}
class ChildOfInner extends Outer.Inner {
ChildOfInner() {
(new Outer()).super(); // (new Outer()) is the Primary
}
}
Does a Primary expression exist that makes the call to super() the invocation of a constructor of the calling class? Or Java prevents that?
I am using JNI to initialize classes in my jar files present at the classpath. But created executable uses java and displays ugly command prompt when my program starts. I want to configure my JNI to use javaw instead. How can I achieve it?
Platform: Windows 7
Do you know a tutorial how to create a CXF web service from existing Java code and embed it in Tomcat, and also generate a wsdl file so that any .NET system would be able to generate client code easily?
I miss that WSDL creation point in, for example this
http://www.ibm.com/developerworks/library/ws-pojo-springcxf/
tutorial. No wsdl file is generated. But still it should be present in my case to provide system interoperability.
Hi All,
I have a JAR on the build path of a medium sized Java application and I would like to know where it's used. At the most basic level if someone could tell me how to 'Find References' for a Jar that would be great.
Whilst I'm looking at dependencies it would be great to find a tool that would map all of my package / external library usages and graph them. I used to have a free plug-in for eclipse that did just that but I haven't been able to rediscover it.
Thanks,
Gav
how to take user input in Array using Java?
i.e we are not initializing it by ourself in our program but the user is going to give its value..
please guide!!
Hello,
How can I clone Array List but also clone its items in Java 1.5?
For example I have:
ArrayList<Dog> dogs = getDogs();
ArrayList<Dog> clonedList = ....something to do with dogs....
And I would expect that objects in clonedList are not the same as in dogs list.
Thanks for any answer!
Hello all,
When running a thread in Android/Java:
public void run()
{
while (running)
{
if (moreTasksToExec())
{
task = getNextTask()
task.exec();
}
}
}
Is it OK to let it run and not using a semaphore to block while no work needs to be executed?
I am only using one thread, so I need no inter-thread synchronization.
I have a Class<? extends Annotation> and tried calling newInstance() but Java yelled at me for the obvious reason that I can't instantiate an interface. But I know frameworks like EasyMock are perfectly capable of instantiating interfaces. What would it take to get a completely dumb Annotation instance out of my Class?