| javax.comm: Writing to a parallel port? |
|
 |
Index ‹ java-programmer
|
- Previous
- 4
- 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,
- 5
- 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
- "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
- 7
- 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
- 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
- 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
- 9
- 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
- 10
- 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)
- 10
- 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
- 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
- 14
- 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.
- 15
- 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
- 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");
...
- 15
- 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!!
- 16
- 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
|
| Author |
Message |
KiLLBoY

|
Posted: 2005-1-6 19:02:00 |
Top |
java-programmer, javax.comm: Writing to a parallel port?
I have the same problem.
No exception raises.
Have no idea what to do.
waiting for anyone's ideas
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- convert hex to longHey
midp 2.0
J2ME Wireless Toolkit 2.2
JDK 5
Long id;
String arg1 = "0b"; //arg1 can also have values like "01", "0a" etc
id = Long.parseLong(arg1);
This converting isn't working with "0b" or "0a"... but I've read in the
documentation of jdk5 that this parseLong is overloaded:
public static long parseLong(String s, int radix), and I guess this is the
correct method to use, but I'm not sure what the second parameter (radix) of
this method is?
Jeff
- 2
- Java programs won't install on HP machineTrying to gather as many details as I can on a particular problem I'm
having right now. Just wanted to post what I have so far in case
anyone out there sees a light go off.
My company sells a java (version 1.4.2) based software package. We
use InstallAnywhere to install. Really haven't had a problem with our
installs on any flavor of Win machines to date.
A customer running Win98 SE on an HP machine (I'll get a model # asap)
calls today and says the installation program hangs his machine
completely after extraction part of the install.
We look at some install log data and it indicates that everything
extracted to Windows temp folder ok. From there the log says "starting
java..."
My understanding is what should happen at this point is the install
process is supposed to start a bundled JVM (i assume in the contents
extracted to the temp folder) and run a .jar file that completes the
installation process. It hangs the machine shortly into this java
part though (the last thing it tried to do is "UI mode set
to"......and off to oblivion...
We eliminated some known issues at this point. Minimum direct X
version to run InstallAnywhere installs is 8.1. Customer has 9.0
installed. All Win updates complete. No viruses on machine.
Anti-virus software disabled for the install. No video driver issues.
These are all things InstallAnywhere tells you to watch for.
Additionally, the install file is not corrupted (same file installs
fine on another machine).
We thought we'd install a current JVM on the machine for sh*t's and
giggles because I believe InstallAnywhere will use it if present.
Downloaded the latest from Sun and the install hangs the machine in
the same manner as our IA installer.
This machine appears not to be able to run java programs at all. What
gives?
- 3
- Tomcat5.5 queryHi,
I have installed tomcat5.5.
In the tomcat docs it is recommended that i install Ant build tool as
well as Concurrent Version System (CVS) too.
Can someone tell me, how much neccesary are these to install and use?
How it can help me for developing my application?
- 4
- Tomcat 5.5 - IIS 6 using isapi_redirect.properties
I am trying to use IIS 6.0 as a front end for Tomcat which I have
working as expected. The issue I have is that I can only get it
working using the registry settings and not using
isapi_redirect.properties. We will have several sites and I want them
to independent of each other and I am not sure how to do this without
using the isapi_redirect.properties files. Please advise. Thanks in
advance.
- 5
- struts templates - template is inserted in wrong placeJust wondering if anyone else has run into this issue. I am using
templates in struts and I use the same template for every form. I
insert a page in one spot on my template file and it works fine on my
machine. When I upload it to the server, it suddenly starts inserting
the page about a quarter of the way down the template instead of where
it is defined to go. Has anyone else experienced this?
- 6
- Mutliple thread access to object methodCan multiple threads access the same object public void method
simultaneously? Or does the method need to return for each thread? I guess
not because that's what public synchronized void is for?
- 7
- please inform a newbclass A{
class B{
boolean flag;
int value;
}
B b[] = new B[10];
public A(){
for (int i = 0; i < 10; i++)
b[i] = new B();
}
}
I'm wondering if there is a more elegant way to instantiate the elements of
b[] than the 'for' loop.
- 8
- JRE 5 on Freebsd 6fbsd6-Mimi# rpm --install jre-1_5_0_05-linux-i586.rp
error: failed dependencies
glibc >= 2.1.2-11 is needed by jre-1.5.0_05-fc
sh-utils >= 2.0-1 is needed by jre-1.5.0_05-fc
fileutils >= 4.0-8 is needed by jre-1.5.0_05-fc
gawk >= 3.0.4-1 is needed by jre-1.5.0_05-fc
textutils >= 2.0-2 is needed by jre-1.5.0_05-fc
/bin/sh is needed by jre-1.5.0_05-fc
/bin/sh is needed by jre-1.5.0_05-fc
/bin/sh is needed by jre-1.5.0_05-fc
this is what I get when try to install the rp
jre-1_5_0_05-linux-i586.rp
I have mounted linprocfs my linux-base is up to date 8.8.0.
I have Javavmwrapper that says that i have no conf file i
/usr/local/et
I do not need JDK I have a jar file i want to start thats al
please help[i:cb2c6e6b3c][/i:cb2c6e6b3c
Sent via Archivaty.com
- 9
- Where can i download the local oracle client?Hi
I want to install oracle client in order to connect Oracle(9i)
database from local web server.I used to go to this
<a href="http://otn.oracle.com/software/index.html">oracle download
link </a>.But i dont know which is the suitable one.Could anyone tell
me?
Thanks
Ricky
- 10
- Query in Prepared statements cachingHii ,
I am using Db2 V 7.1 on ZOS
I have the following Java Code
query.append("insert into ");
query.append(schemaName+".EMAIL_DATA ");
query.append("(EMAIL_NBR, DT_FIRST_SENT,SUBJECT
,EMAIL_ADDR,EMAIL_DTL,ER_NBR, DT_CREATED,DT_LAST_SENT)
values(?,?,?,?,?,?,?,?) ");
prepStmt=connect.prepareStatement(query.toString());
I want to know whether the above query would be cached in the data
base server since apart from the using the standard ? to give various
parameters at runtime , I am also picking up the schema at runtime and
not hardcoding.
But obviously the schema name will remain the same for all the calls
to the DB.
I donno whether due to the usage of a Java Variable in the query at
runtime whether this will be cached or not ?
Can some one please throw some light on it ?
Regarda,
-Neeraj
- 11
- FirewireHello everyone,
Does Java's API include Firewire support? I have been doing some googling
and all I can find are projects that have been started but not completed.
I'm looking for Firewire support for both Linux and Windows.
Anything information or tips would be great, thank you.
---
Alvn Beach
Email: email***@***.com
Website: http://users.eastlink.ca/~alvinbeach
- 12
- Please Help - Java, Database oracle or sybaseHi All,
I am a java programmer used to using oracle database.
In my new job, we have oracle plus sybase database. Some applications
use oracle and some use Sybase. I am writing framework, so it can be
used by all applications.
Is it possible to write connection code, independent of database
driver, by just using java.sql package.
One problem I am seeing in sql package is java.sql.types does not have
cursor. I don't know how sybase returns a resultset but java.sql.other
does not look very promising.
Could any body suggest a general solution using two different database.
Thanks a lot,
Jill.
- 13
- how does ANT work?On Fri, 11 Jul 2003, Roedy Green <email***@***.com> wrote:
> Does ANT work by parsing any changed file to discover the
> dependencies?
Depends on the task you are talking about. For most tasks, including
<javac> it does not. <javac> simply compares the timestamps of *.java
and *.class and compiles those files with outdated .class files.
<depend> in turn parses the compiled .class files to discover
dependencies, then compares the timestamps of .class files to the
.java files and deletes all .class files that are older then the .java
files of any class they depend upon. <javac>'s timestamp checking
after that is going to succeed then.
There are third party tasks like <javamake> - see Ant's external tools
page - that can do that in one step and are more sophisticated.
> Can it be relied on to recompile everything that needs it if a
> static final changes?
No.
And a static final primitive will be inlined by the compiler so even
<depend> will not detect the change (as it wouldn't detect the
dependency) - not sure whether <javamake> would.
> Is ANT smart enough to avoid loading the compiler over and over for
> each file; i.e. does it invoke it only once for the whole shot?
It will invoke the compiler exactly once per <javac> task (that
actually needs to compile at least one file).
Stefan
- 14
- Read-only methods for webservices with JavaBeansHello,
unfortunately i wrote this thread before in german, so i will do this
in english again.
Here we've got a standalone application which stores several data on
an SQL Server. In the last time we added a webservice to display and
sometimes modify several information from this data via webpages
(JSP). Many functions are already implemented and working fine. We
have webservicemethods returning objects stored in javabeans. To get
the data out of the beans, we have to use some get methods. Some data
is "READ-ONLY", so we don't want any set method there. The problem is:
If we don't write some "dummy" Set-Methods, wscompile will not
generate the needed get-Methods. We find that writing dummy-methods is
not a very fine way.
Is there another easy posibility to make the getMethods available for
the client without writing dummy set methods like this?
// That's what we don't need but have to write in order to make
wscompile ready to produce the getMethod
public void setName(String value) {}
// That's what we need only
public String getName()
{
return name;
}
Greetings and thnx a lot!
Andreas
- 15
- SAX reserved XML char encoding/decodingHi,
Is there an option to get the Sax parser (java 1.5) to convert xml safe encoding
sequences back to the original character, as returned by the Contents() event?
For example "<" back to "<" ?
Thanks.
Ben
PS (and what's with comp.lang.java.api? - nothing seems to register there since
sept 2004. , including my post of this question there)
|
|
|