 |
 |
Index ‹ java-programmer
|
- Previous
- 2
- MQ Series messages browse and deleteHi,
I am writing an MQ client that should get messages from MQ Queue one
by one and then delete it in case of successful processing.
As documented in MQ Series Programming Guide a queue should be opened
for browsing and removing. For browsing an option
MQGMO_BROWSE_FIRST or MQGMO_BROWSE_NEXT should be used and for
deleting MQGMO_BROWSE_MSG_UNDER_CURSOR.
Browsing works fine for me but delete does not - all messages remain
in a queue.
Thanks
Following is a code fragment:
.................
try {
mQMgr = new MQQueueManager(remoteQManager);
int openInputOptions = MQC.MQOO_FAIL_IF_QUIESCING |
MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE;
outputQueue=mQMgr.accessQueue(remoteQueue, openInputOptions);
MQMessage retrievedMessage = new MQMessage();
MQGetMessageOptions gmo=new MQGetMessageOptions();
gmo.options=MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;
gmo.matchOptions=MQC.MQMO_NONE;
gmo.waitInterval=10000;
while(true) {
if(c>0) { gmo.options = MQC.MQGMO_WAIT |
MQC.MQGMO_BROWSE_NEXT; }
outputQueue.get(retrievedMessage, gmo);
msg=retrievedMessage.readString(retrievedMessage.getMessageLength());
System.out.println("************************ message "+c+"
********************** " + retrievedMessage.persistence);
System.out.println("RETRIEVED MESSAGE: "+msg);
System.out.println("REMOVING
.................................");
gmo.options = MQC.MQGMO_WAIT |
MQC.MQGMO_BROWSE_MSG_UNDER_CURSOR;
outputQueue.get(retrievedMessage, gmo);
c++;
}
} catch (MQException mqe) {
if(mqe.reasonCode == mqe.MQRC_NO_MSG_AVAILABLE) {
System.out.println("NO MORE MESSAGES AVAILABLE, RETRIEVED
"+c);
return;
}
mqe.printStackTrace();
} catch (java.io.IOException ioe) {
ioe.printStackTrace(System.out);
return;
} finally {
try {
System.out.println("CLOSING A QUEUE & MANAGER");
if(outputQueue != null) { outputQueue.close(); }
if(mQMgr != null) { mQMgr.disconnect(); }
}
catch (MQException ex) {
ex.printStackTrace();
}
}
- 2
- A similar problemHi,
I get a similar stack except that the exception is a ServletException.
I can't figure this out at all. Here's the field validation declaration
that I am trying to use.
<field property="clientaPlannedRetirementAge" depends="validwhen"
page="1">
<arg position="0"
key="lnra.clienta.clientaPlannedRetirementAge"/>
<var>
<var-name>test</var-name>
<var-value>(clientaExpectedAgeAtDeath >90)</var-value>
</var>
</field>
Does anyone have any clues as to what this might be?
Thanks
[ERROR] ServletException raised in AuthorizationFilter:
javax.servlet.ServletException: antlr/TokenStream
at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:143)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at
com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1166)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:676)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:203)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
at
com.amfam.needsanalysis.authorization.AuthorizationFilter.doFilter(AuthorizationFilter.java:82)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
at
com.amfam.internalsso.AmfamSecurityFilter.doFilter(AmfamSecurityFilter.java:115)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1162)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:676)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:203)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:300)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at
com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:120)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:250)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:458)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:936)
- [AuthorizationFilter]
- 3
- tcpmon loggingHi all,
I find the tcpmon utility from apache.org very useful. But is there
any way to make the tcpmon to log the http request + response into
local file instead of just displaying at the GUI, so it is easier for
me to trace later?
Thank you.
Best regards,
John
- 4
- Connection PooledI want to use connection pool just like those mensioned in the following
link but for MSSQL
and MySQL. Do I have to depend on the vendor package?
http://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96654/connpoca.htm#1057365
SK
- 5
- Tomcat can't find antRun scriptI've been developing a web site on XP and deploying it on Unix (Solaris)
using
Tomcat 4.0.6 on the Unix box.
In the last deployment of my class files, I also moved some jar files to
$TOMCAT/common/lib
and made some changed to server.xml to implemnet connection pooling.
Now Tomcat won't compile a JSP page giving the message:
Cannot locate antRun script: property 'ant.home' not found.
I can't figure out what I broke. Can anyone tell me where this
ant.home property should be set and and/or where antRun should
live? I (believe) I have restored the server.xml and jar files to their
originals but I still have the problem.
I appreciate your help in getting me un-stuck.
jim cant
- 5
- JUnit RemoteTestRunner ErrorHi. I was running a test suite under JUnit version 3.7.0 through
XDE/Eclipse version 2.0.1 and I got a null pointer error. When I
stepped through the program, I saw that the error occurs right when I
get a window telling me
that "org.eclipse.jdt.runner.RemoteTestRunner" type cannot be found.
Do I need this type? It does not seem to be in the junit.jar file.
Thanks for any info,
Ken
- 6
- How to convert int/float etc into byte[]?For example
int i = 2;
char c = 'c';
float f = (float)3.45;
double d = 3.546;
String s = "Hello";
I want to write all these into a binary file.
In OutputStream, PrintStream classes
they have
write(int byte); and
write(byte[] buffer, int offset, int length);
My question is how do I convert those i,c,f,d,s into
byte[]?
Thank Q in advance!
- 7
- 8
- FreeBSD Java porting project questionsHi all.
I have some questions about this freebsd port.
1)Why we need linux jdk, when building a native distr?
Is that necesarily to build compiler with classes semultaneusly?
2)What are you think about java (and of course jdk) future on freebsd.
I saw freebsdfoundations last message dated last year, and nothing more.
Doesnt project stop or going to?
Thanks for all answers. I really interesting about this
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 9
- OpenCMS help!I'm trying to install OpenCMS with MS SqlServer.
Then i have error:
javax.servlet.ServletException: OpenCms initialization error!
Could not connect to the database. Is the database up and running?
at com.opencms.core.OpenCmsHttpServlet.init(OpenCmsHttpServlet.java:245)
......
I'm checking MS SqlServer database is running.
What happen about it?
Can everyone help me now?
Thank before!
- 11
- Kill a thread automaticallyHi,
If I have a class that runs a thread and no reference points to it, the
gc won't finalize the class because the thread is still running -> so
stopping the thread in the finalize() method won't work. Afaik this is
also true for daemon threads.
Is it possible to stop a thread automatically when there are no
references left? In my case it does not matter if the thread is
gracefully interrupted or just killed and whiped out.
greets,
-adi
- 11
- Any Source Code or Web site demonstrate the effect of gridwidth and gridheigh of GridBaglayoutDear all,
I want to make clear how the outlook of Gridbaglayout will
change according to different value of gridwidth and gridheight of
GridBagConstraints. Please suggest some source code for me so that I
can modify the source code of the value of gridheight and gridwidth,
thus I can find out the change of the outlook according to different
value of gridheight and gridwidth. Or please suggest some website for
me to investigate about the gridwidth and gridheight of
GridBagConstraints.
Thanks.
- 11
- Closing sockets and streams?If I have a socket and an InputStream and OutputStream that I have
opened from that socket, do I need to close the streams when I am
finished if I close the socket?
--
Knute Johnson
email s/nospam/knute/
- 12
- How do I receive SOAP Messages via HTTP from an App?Hi,
I have a Java Application. It is both a socket server and a socket
client. I can run the app on multiple computers and they can connect to
each other.
I can create SOAPMessages and use a SOAPConnection to send these
messages to listening sockets on the other computers.
I'm having trouble taking the received SOAP message as a byte stream
and converting it to a Java SOAPMessage.
How should I do this?
I think I need an HTTP Server. Is this correct? Is there one included
in the J2SE or J2EE classes?
Thanks!
John
- 12
- how to send formatted text like in chat programeshello ,
i would like rto ask how to send formatted text, like italic , font
size, blah blah
from one computer clientt o client like chat programes , i l know to
send plain text, i their ways to send formatted text , i think may be
html format but i need more solution please...
islam
|
| Author |
Message |
Constant Meiring

|
Posted: 2006-10-18 7:24:00 |
Top |
java-programmer, Java symbol confusion
Hi there,
I started learning myself java a while ago and there's still loads of
concepts and things about the java language i don't know, so i may just
make an arse of myself now...
I use the NetBeans 5.0 IDE to play around with. Sometimes it does
things that I think (from what I've learned about java) that it
shouldn't do. I may just be stupid or something, so could somebody
point out my faults. Here's a piece of code:
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
try {
ServerSocket serverSocket = new ServerSocket(56);
}catch (IOException e) {System.out.println("Daar was kak in die
konneksie...");}
Socket clientSocket = null;
<<------------------------------------
clientSocket = serverSocket.accept();
<<------------------------------------
}
}
Ok that's just part of it. I'm still learning how to do the rest. Ok,
my first problem here is that when the two lines marked with arrows
above is out of the try-catch block, NetBeans tells me it can't find
the symbol serverSocket. On the other hand, when I put the two marked
lines inside of the try-catch block, it works without a problem. Can
someone explain to me why this is happening??
===========WORKING=============
try {
ServerSocket serverSocket = new ServerSocket(56);
Socket clientSocket = null;
clientSocket = serverSocket.accept();
}catch (IOException e) {System.out.println("Daar was kak in die
konneksie...");}
===========NOT WORKING=============
try {
ServerSocket serverSocket = new ServerSocket(56);
}catch (IOException e) {System.out.println("Daar was kak in die
konneksie...");}
Socket clientSocket = null;
clientSocket = serverSocket.accept();
It says:
C:\Documents and
Settings\Constant\netServer\src\netserver\Main.java:22: cannot find
symbol
symbol : variable serverSocket
location: class Main
clientSocket = serverSocket.accept();
1 error
BUILD FAILED (total time: 0 seconds)
|
| |
|
| |
 |
Matt Humphrey

|
Posted: 2006-10-18 7:35:00 |
Top |
java-programmer >> Java symbol confusion
"Constant Meiring" <email***@***.com> wrote in message
news:email***@***.com...
> Hi there,
>
> I started learning myself java a while ago and there's still loads of
> concepts and things about the java language i don't know, so i may just
> make an arse of myself now...
>
> I use the NetBeans 5.0 IDE to play around with. Sometimes it does
> things that I think (from what I've learned about java) that it
> shouldn't do. I may just be stupid or something, so could somebody
> point out my faults. Here's a piece of code:
>
> import java.net.*;
> import java.io.*;
>
> public class Main {
>
> public static void main(String[] args) {
>
> try {
> ServerSocket serverSocket = new ServerSocket(56);
>
> }catch (IOException e) {System.out.println("Daar was kak in die
> konneksie...");}
>
> Socket clientSocket = null;
> <<------------------------------------
> clientSocket = serverSocket.accept();
> <<------------------------------------
> }
> }
>
> Ok that's just part of it. I'm still learning how to do the rest. Ok,
> my first problem here is that when the two lines marked with arrows
> above is out of the try-catch block, NetBeans tells me it can't find
> the symbol serverSocket. On the other hand, when I put the two marked
> lines inside of the try-catch block, it works without a problem. Can
> someone explain to me why this is happening??
The name "serverSocket" is a local variable and that name exists only from
the { of the try to the } before the catch. After that } the name no longer
exists, so you can't use it within the catch expression or afterwards. Put
ServerSocket = null; before the try { and remove the ServerSocket
declaration. The name will then exist for the entire method body.
Matt Humphrey email***@***.com http://www.iviz.com/
|
| |
|
| |
 |
Oliver Wong

|
Posted: 2006-10-20 2:12:00 |
Top |
java-programmer >> Java symbol confusion
"Matt Humphrey" <email***@***.com> wrote in message
news:email***@***.com...
>
> "Constant Meiring" <email***@***.com> wrote in message
> news:email***@***.com...
>>
>> I started learning myself java a while ago and there's still loads of
>> concepts and things about the java language i don't know
[...]
>> my first problem here is that when the two lines marked with arrows
>> above is out of the try-catch block, NetBeans tells me it can't find
>> the symbol serverSocket. On the other hand, when I put the two marked
>> lines inside of the try-catch block, it works without a problem. Can
>> someone explain to me why this is happening??
>
> The name "serverSocket" is a local variable and that name exists only from
> the { of the try to the } before the catch. After that } the name no
> longer exists, so you can't use it within the catch expression or
> afterwards. Put ServerSocket = null; before the try { and remove the
> ServerSocket declaration. The name will then exist for the entire method
> body.
If you want to learn more about this concept, the name of this concept
is "scope". The scope of the variable is within that try block. When you
move your assignment statement outside of the try block, you're referring to
the variable outside of its scope, meaning it can't be found by the
compiler.
The "scope" concept isn't Java specific; it exists in most other
programming languages as well.
- Oliver
|
| |
|
| |
 |
Constant Meiring

|
Posted: 2006-10-23 19:37:00 |
Top |
java-programmer >> Java symbol confusion
Thanx now I know why you have to put an object = null sometimes.
Thanx alot!
-Constant
Matt Humphrey wrote:
> "Constant Meiring" <email***@***.com> wrote in message
> news:email***@***.com...
> > Hi there,
> >
> > I started learning myself java a while ago and there's still loads of
> > concepts and things about the java language i don't know, so i may just
> > make an arse of myself now...
> >
> > I use the NetBeans 5.0 IDE to play around with. Sometimes it does
> > things that I think (from what I've learned about java) that it
> > shouldn't do. I may just be stupid or something, so could somebody
> > point out my faults. Here's a piece of code:
> >
> > import java.net.*;
> > import java.io.*;
> >
> > public class Main {
> >
> > public static void main(String[] args) {
> >
> > try {
> > ServerSocket serverSocket = new ServerSocket(56);
> >
> > }catch (IOException e) {System.out.println("Daar was kak in die
> > konneksie...");}
> >
> > Socket clientSocket = null;
> > <<------------------------------------
> > clientSocket = serverSocket.accept();
> > <<------------------------------------
> > }
> > }
> >
> > Ok that's just part of it. I'm still learning how to do the rest. Ok,
> > my first problem here is that when the two lines marked with arrows
> > above is out of the try-catch block, NetBeans tells me it can't find
> > the symbol serverSocket. On the other hand, when I put the two marked
> > lines inside of the try-catch block, it works without a problem. Can
> > someone explain to me why this is happening??
>
> The name "serverSocket" is a local variable and that name exists only from
> the { of the try to the } before the catch. After that } the name no longer
> exists, so you can't use it within the catch expression or afterwards. Put
> ServerSocket = null; before the try { and remove the ServerSocket
> declaration. The name will then exist for the entire method body.
>
> Matt Humphrey email***@***.com http://www.iviz.com/
|
| |
|
| |
 |
Oliver Wong

|
Posted: 2006-10-23 22:19:00 |
Top |
java-programmer >> Java symbol confusion
[post re-ordered]
"Constant Meiring" <email***@***.com> wrote in message
news:email***@***.com...
> Matt Humphrey wrote:
>> "Constant Meiring" <email***@***.com> wrote in message
>> news:email***@***.com...
>> >
>> > I started learning myself java a while ago and there's still loads of
>> > concepts and things about the java language i don't know, so i may just
>> > make an arse of myself now...
>> >
[...]
>> > my first problem here is that when the two lines marked with arrows
>> > above is out of the try-catch block, NetBeans tells me it can't find
>> > the symbol serverSocket. On the other hand, when I put the two marked
>> > lines inside of the try-catch block, it works without a problem. Can
>> > someone explain to me why this is happening??
>>
>> The name "serverSocket" is a local variable and that name exists only
>> from
>> the { of the try to the } before the catch. After that } the name no
>> longer
>> exists, so you can't use it within the catch expression or afterwards.
>> Put
>> ServerSocket = null; before the try { and remove the ServerSocket
>> declaration. The name will then exist for the entire method body.
>>
>
> Thanx now I know why you have to put an object = null sometimes.
You only ever need to put an object = null if you actually want that
object to be null. If you want to declare a variable to exist at a certain
scope level, but not assign to it, you can do that too:
public class Main {
public static void main(String[] args) {
ServerSocket serverSocket; /*Don't assign any value to it yet.*/
try {
serverSocket = new ServerSocket(56);
} catch (IOException e) {
System.out.println("Couldn't create server socket. Aborting.");
System.exit(-1);
}
clientSocket = serverSocket.accept(); /*presumably, clientSocket was
declared somewhere*/
}
}
- Oliver
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Simple ClassLoaderHi!
Say that I have a string of bytes (byte[]) defining a class, how do I
create a simple ClassLoader to define the class?
Regards,
Jesper
- 2
- Ant testing jar for differences
Hi,
I'm trying to implement this logic in an Ant build script:
1) Put all .class files into a new tempLatestBuild.jar
2) If HASH(tempLatestBuild.jar) != HASH(
previousLatestBuild.jar) replace...
I've done this with web.xml and various other config files,
but jars change everytime (even though the .class and MANIFEST.MF file
do not).
With the <jar> task, the MANIFEST.MF timestamp was different
every time in the resultant jar.... So I changed it to a <zip> task
and copied in the MANIFEST.MF by hand.
This fixed the timestamp issue, but there are still two bytes
difference, and I can't see what they are. All the flags on the files
look ok (examined in winzip and when unzipped).
Has anyone done this kind of thing?
Cheers,
- 3
- using soap/java/perl or some such to search the web ?This is what I'd like to do for a project if possible,
I've read a little bit that various search engines and other tools
through
soap or something give you hooks into web search capabilities.
I want to search womens profiles on yahoo personals, possibly I will
mark some of those profiles based on the pictures. This part would be
partially manual through an interface I might design. After that I
would want to run those
marked personal profiles through some other code. I'm thinking this
code might have to decode the actual html a bit. What it would do is
look for certain keywords and then generate a customized reply to that
personal ad based on common interests and so on, or mark certain ads
as highly relevant based on keywords. For instance if a girl had
camping listed in her profile, my response letter might include
something about how I like camping, I have a truck camper and so on.
But if it did not find any keywords, it would not make as much of a
mention camping in the generated response letter. Once I have
generated response letters, I would have some sort of manual process
where I have to go and type in the coded thingamajigs they generate.
I'm not sure how hard all this would be or how high level/low level I
want to go with it or where to start, though I am an experienced C++
programmer, have done java/perl and so on. I think yahoo uses java
script. I have seen books on java script, using perl for this sort of
thing as well.
Any thoughs appreciated.
- 4
- Java One?Did anyone get to go to Java One? What impressed you?
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
- 5
- Hi ALl - Plz HELpHi Friends,
I would be highly grateful if anyone can provide a solution for the
following :
There is a MS-SQL server hosted on a machine which is our data server.
We need to access this data server through many client machines. To
secure the data exchange between client(s) & Data server we use
JSECURE Client for SSL communication. But this secures the channel
between client machine and the machine on which my MS -SQL server
is hosted. Once the data is received on server machine, JSECURE
decrypts the data and sends to the data server. Now if I enable the
SSL
on MS-SQL server , I guess my communication would fail because I
don't
know which algorithms are being used by MS-SQL server & JSECURE
to encrypt their respective data's. So , in this case I need a bridge
between
these two ( Precisely a TRANSLATOR which understands both - JSECURE
& MS-SQL SERVERS).
Please let me know if any such solution exists. Thanks a lot to you
all friends!!
- 6
- httpConnectionhi alls!
i'm work in a aplication that needs access very often to the class
httpConnection and it makes but very slow.
if i put the ip into the call to httpConnection:
HTTPConnection connection = new HTTPConnection(10.10.10.10);
httpConnection goes to dns???
and later when i do:
connection.Get(url.getFile());
goes again to dns?
thanks alls
- 7
- Java SSH / Telnet client SourceHi all,
I am trying to create a ssh/telnet client as a Java application.
I am new to network programming but I have gathered some tutorials
which have helped me get a grip with it.
My question is, does anybody know where I might find some tutorials or
code that might melp me in learning to create such an application?
Any help at all would be much aprechiated.
Kind Regards,
Ted
- 8
- Graph/Network frameworksHi,
Did anyone have some experience with graph/network frameworks like JUNG?
If you worked with something else please recommend.
Tnx.
--
Greatest shits:
http://www.net.hr/vijesti/page/2007/03/30/0030006.html
- 9
- Java Programming: Advanced topics - Sample codeHi,
I am trying to get a Java Bean sample code from Java Programming:
Advanced topics book working.
I have modified the code for SQL Server, it does not work??
The Java Virtual Machine throws a "could not find the main class"????
Could anyone point out what I am doing wrong.
I can get a db connection in a JSP page, am trying to create a
container that I can call the
variable from the JSP page.
Thanks for your help.
Clive
java.lang.NoClassDefFoundError: project1/DBdemo
Exception in thread main
package project1;
import java.sql.*;
/**
* Class to create connection to a database and
* and demonstrate basic SQL queries
*/
public class DBdemo {
/**
* the connection object
*/
static Connection connection = null;
// select DB2 type 2 driver
static final String dbDriver = "net.sourceforge.jtds.jdbc";
static final String dbUrl = "jdbc:jtds:sqlserver://localhost:
1032/";
// use the SKICLUB database
static final String dbName = "Calibration";
// set dbUser to any user on your Windows OS
static final String dbUser = "userid";
// set dbPassword to Windows password for dbUser
static final String dbPassword = "password";
/**
* method to open the connection
*/
public Connection getConnection() {
if ( connection != null )
return connection;
try {
connection = DriverManager.getConnection(
dbUrl, dbUser, dbPassword );
} catch( SQLException e ) {
System.err.println("Cannot connect to database: for SQl
server, " + "check that SQl is running and " + "the SKICLUB database
exists." );
}
return connection;
}
public ResultSet getAllMemberInfo() {
ResultSet rs = null;
try {
Statement statement =
getConnection().createStatement();
String sql = "Select * from Prop1_Wallfinish,
Users where Prop1_Wallfinish.SurveyID= Users.SurveyIDS";
System.out.println( sql );
statement.executeQuery( sql );
rs = statement.getResultSet();
} catch( SQLException e ) {
System.out.println(
"SQLException " + e.getMessage() );
} finally {
return rs;
}
}
public static void main(String[] args) {
DBdemo dbdemo = new DBdemo();
System.out.println("Getting Database driver" );
try {
Class.forName( dbDriver );
} catch( ClassNotFoundException e ) {
System.err.println("Cannot load database
driver: for SQL, " + "your classpath must include " + "SQLLIB\\JAVA12\
\DB2JAVA.ZIP." );
}
System.out.println(
"Getting Database connection" );
Connection connection = dbdemo.getConnection();
if ( connection == null )
System.exit(0);
System.out.println( "Database ready" );
try {
// demonstrate a SELECT Statement
dbdemo.getAllMemberInfo();
connection.close();
} catch (Exception e) {
System.err.println(
e.getClass().getName() + ": " +
e.getMessage() );
}
}// end public main
} // end DB
- 10
- High performance file creationHi everyone
I have a servlet that queries a database, processes the ResultSet,
turns it into a n String[][] and sends it by Serialization into an
applet that contains basically a JTable to display the contents to the
user.
Now, somewhere in the middle of this, a StringBuffer is filled with
the contents of the String[][] so an CSV file can be created on the
server for the final user to download. The ideia is to display the
data on the applet and manipulate it on the Excel sheet.
But... the applet updates the JTable with the table faster than the
file can be written on the server, so when the link is shown on the
webpage the file hasn't been created and when the user tries to save
it, it returns an error.
Is there a way for me to create the file faster than the applet is
created?
Thank you very much
Rui Pacheco
- 11
- "standards" for tooltips?All,
I'm working on a large Swing app. which has inconsistent use of
tooltips. In fact I have to address a bug report complaining about the
inconsistencies of the tooltips. Some of our widgets display "helpful
text" as tooltips, others display the full details on the chosen value
(e.g. full pathname of a file chosen) etc.
Is there any documented standard for how best to use tooltips?
TIA,
Sean
- 12
- Compile in memory java source?Hello,
Does anyone know of a java compiler which can be launched in process to
compile an in memory representation of a java source file? Essentially,
I generate some source on the fly and I'd like to avoid having to write
it to disk and all the messiness (permissions, cleanup, etc) that come
with that. I was surprised to find that javac didn't (as far as I could
tell) support this interaction. Can anyone point me towards a tool
which does what I need? Thanks in advance.
-exits
- 13
- classpath problems with jar filesokay, i have an odd problem... and maybe it's platform-specific... but i
figure give it a shot and ask about it in case someone has seen this.
i have an application that is made up of numerous class files. this
application at one point loads a class from another company using the
command Class.forName(...).
when i compile the .java files to bytecode and execute from the main()
entry point, it works fine.
than i create a jar file, and include a manifest line to point to the
class containing the main() entry point. then i execute the jar file
(java -jar jarfile).
the program starts running fine, but throws a class not found exception
when it hits the Class.forName() line.
everything else is the same... same classpath setting, and the other class
files haven't moved (the other classes are in fact in a jar file which is
included in the classpath).
so to sum it up... app works fine when not in jar file. jar it up, and
run with everything else the same... cannot load some external classes.
now, i am running jdk1.4.1 on mac os x.
any thoughts?
murat
--
Murat Tasan
email***@***.com
email***@***.com
email***@***.com
http://genomics.cwru.edu
- 14
- Tomcat 5 ClusteringHi All,
I am a Tomcat newbie running Tomcat 5 and I would like to implement
clustering between 2 servers. I followed the instructions given at
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cluster-howto.html
When I uncomment the cluster tag in server.xml and the replication
valve (as per the instructions) I got the following error upon
starting up Tomcat. Does anyone know why???
Thank You,
Matt
[ERROR] Digester - -Begin event threw error
<java.lang.NoClassDefFoundError:
java/lang/CharSequence>java.lang.NoClassDefFoundError: java/lang/
CharSequence
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:253)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:112)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:515)
at org.apache.catalina.startup.Catalina.load(Catalina.java:553)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:397)
- 15
- Reading data from Text fileimran wrote:
> Hello,
>
> I have a problem on reading data from Text file(notepad) and save as
a
It looks like a Properties object is what you need. You could do
something like:
FileInputStream fis = new FileInputStream("injector.txt");
Properties props = new Properties();
props.load(fis);
String classString = props.getProperty("classString");
...
|
|
|