I am developing a Flex-based game, and struggling with SmartFox Server.
Anyway, it's a java-based server for Flash platform games, and it's kind of clunky to develop with on Windows. So, I want to be able to start it (and stop it) via Eclipse rather than the current batch file nastiness they provide.
The problem is I've never done th...
I'm trying to follow Sun's JDBC tutorial at http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html
It gives the following example code:
DataSource ds = (DataSource) org.apache.derby.jdbc.ClientDataSource()
ds.setPort(1527);
ds.setHost("localhost");
ds.setUser("APP")
ds.setPassword("APP");
Connection con = ds.getConnection...
I have a Java application that receives data over a socket using an InputStreamReader. It reports "Cp1252" from its getEncoding method:
/* java.net. */ Socket Sock = ...;
InputStreamReader is = new InputStreamReader(Sock.getInputStream());
System.out.println("Character encoding = " + is.getEncoding());
// Prints "Character encoding = Cp...
Hi,
I am writing an application which uses web services to connect a remote server.I have written a method to ping function to determine if the server is online or not(i.e. its providing the web services which can be accessed using host:port).I am executing a simple web service with a 2 sec timeout(available as an option in stub class b...
What would be the correct way to find a string like this in a large xml:
<ser:serviceItemValues>
<ord1:label>Start Type</ord1:label>
<ord1:value>Loop</ord1:value>
<ord1:valueCd/>
<ord1:activityCd>iactn</ord1:activityCd>
</ser:serviceItemValues>
1st in this xml there will be a lot of repeats of the element above with d...
I have a J2EE application that needs to be distributed to customers, who will have application servers of their own choice. What is the recommended way of writing a build script that would compile the J2EE application sources (at customer sites) so that they will eventually be able to deploy the application on their servers ?
Moreover, ...
According to Charles Nutter, Duby is
a static-typed language with Ruby's
syntax and Java's type system. Duby
supports all Ruby's literals, uses
local type inference (only argument
types must be declared), and runs as
fast as Java (because it produces
nearly identical bytecode). But with
the advent of invokedynamic, Duby...
I have the following pattern:
(COMPANY) -277.9887 (ASP,) -277.9887 (INC.)
I want the final output to be:
COMPANY ASP, INC.
Currently I have the following code and it keeps returning the original pattern ( I assume because the group all falls between the first '(' and last ')'
Pattern p = Pattern.compile("((.*))",Pattern.DOTALL);
Ma...
Hi,
I implemented XML-RPC client and server on localhost.The server is running ok.but when I run client following errors occurred:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
at org.apache.xmlrpc.XmlRpc.createTypeFactory(XmlRpc.java:235)
at org.apache.xmlrpc.XmlRpc.(XmlRpc...
I'm wondering if there's a way to determine which version of Linux I'm running (ie differentiate between RHEL4, RHEL5) from within the JVM. I'm just looking for a consistent way to differentiate between the operating systems and their versions.
...
I need to know if a client of my web service has successfully received a message. If the client does not receive the message (network goes down for the client in the middle of the call), I want to rollback my changes, so the next call they make will give them the same data that they attempted to get the first time.
Each call to the web...
I know, that if i pass:
primitive type, then copy of element will be sent
object type, then copy of reference will be sent
I assume that (please verify):
Reference size is equal with object element size
Object size is sum of all primitive and reference type sizes that it contains
Static variables are not contained in object
if pr...
Is there a way with WebSphere 6.1.0.25 to prevent an enterprise application from starting due to an exception? I have a ServletContextListener that I rigged to throw a RuntimeException during contextInitialized(). This produces a stack trace in the server's log, however the WebSphere console still shows the application as starting succ...
I want to cache data for a user session in a web application built on struts.What is the best way to do it .Currently we store certain information from the DB in java objects in the user's session .Works fine till now but people are now concerned about memory usage etc.
Any thought on how best to get around this problem.
...
Why Java, C and C++ (maybe other languages also) do not allow more than one type on for-loop variables? For example:
for (int i = 0; i < 15; i++)
in this case we have a loop variable i, which is the loop counter.
But I may want to have another variable which scope is limited to the loop, not to each iteration. For example:
for (int ...
I've got a DLL written in C (that I can't edit) that has some function prototype that looks like
#include <stdio.h>
void foo(FILE *bar);
I'd like to create a JNA interface to the DLL and it's unclear what I need to pass for the FILE *bar argument. I assume I need to pass an InputStream (which is my preference), but the JNA literature...
Hi,
I have a client service utilizing wsdls and xsd's to talk to a service. Problem is when I try to compile and convert java to wsdl I keep on getting this error: "[java] java.io.IOException: WSDL2Java emitter timed out (this often means the WSDL at the specified URL is inaccessible)"
After some googling I found out that this is a kno...
public class A { //some fields (may not only primitive types) and methods here}
public class B {// some fields (may not only primitive types) and methods here, may also have a class A reference }
Questions are followed :
public class Test{
public static void main(String[] args){
A a = new A();//1. it will allocate memory f...
So we have our J2EE application using Log4j like this
public class CustomerController
{
private static Logger logger = Logger.getLogger(CustomerController.class);
public CustomerService customerservice = null;
public CustomerController() throws Exception
{
PropertyConfigurator.configureAndWatch("c:\log4j.p...
I've been trying to no avail to set up a simple Struts2 application so I can get on with learning the framework. Basically, what I am expecting to happen is that when an action is triggered that isn't defined, then a default page will be displayed.
This app is being developed in Eclipse.
I have a very simple struts.xml file set up in t...