Win a copy of Java Challengers this week in the Java in General forum!

Brian Nguyen

Greenhorn
+ Follow
since Mar 19, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brian Nguyen

Hi,
This is something that I read from one of Study book:
Class Modifiers:
- You are free to use strictfp in combination with abstract or final...
Abstract Methods:
- Abstract methods cannot be marked as synchronized, strictfp or native...

So my question here is that why we can have a combination of abstract class and strictfp but not the combination of abstract method and strictfp?

Thanks for your answer in advance.
Brian
Hi,
We are currently having a system that using Struts and we would like have another interface (command line etc...) which is not web. So I am wondering if we have any way to call the Struts actions in the existing system but not in web context?
Thanks for your help in advance.
Brian
16 years ago
Hi All,
I am trying to write a method that writes a String into a file:
--------------------------------------------------------------
private synchronized void saveTicketsToFile(String inTickets){
try{
String fullPathFilename = "D:/learn/e_ticket.dat";
BufferedWriter writer = new BufferedWriter(new FileWriter(fullPathFilename));
writer.write(inTickets);
writer.flush();
writer.close();
} catch (Exception e){
System.out.println("ERROR: " + e);
e.printStackTrace();
}

--------------------------------------------------------------
However, everytime I run this program, I always have the following error:
ERROR: java.lang.IllegalArgumentException: Null charset name

Here is the stack trace that I have:
at java.nio.charset.Charset.lookup(Charset.java:376)
at java.nio.charset.Charset.isSupported(Charset.java:405)
at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:68)
at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:93)
at java.io.FileWriter.<init>(FileWriter.java:61)


So I am wondering if anyone could explain why I have that problem with Charset?
Thank you very much for your help!
Brian

[ October 11, 2004: Message edited by: Brian Nguyen ]
[ October 11, 2004: Message edited by: Brian Nguyen ]
16 years ago
Hi All,
I just have a little question about char literal:

char c6 = '\uface';

Why the above declaration valid? As I know if we use hexadecimal literal, we have to put a prefix with 0x. Does that mean that if we use unicode, the base would be hexadecimal?

Thanks,
Brian
Hi,
I just have two questions about the inner class:
In the inner class defined in a method, it cannot access local variables except those that marked final. Is there any reason why it can access the final variables?
Thanks,
Brian
[ September 02, 2004: Message edited by: Brian Nguyen ]
Hi,
I have a lot jar files in a directory in windows, and I want to add all of these jar files to classpath in startWeblogic.cmd
So I add the follow for loop in the startWeblogic.cmd:
for %%i in (%DIR_JAR%) do set CLASSPATH=%CLASSPATH%;%%i
However, it doesn't work. Does anyone know how to fix the problem?
Thanks,
Brian
17 years ago
Hello,
I am just curious about the following method declaration:
public static synchronized void methodA(){}
What is the meaning of "static" fiel here?
Does it mean that in an multithreaded environment, only one thread can call the above method of the class at a time?
Thanks for your answer in advance
Brian
18 years ago
Hello,
I am just trying to use Jcrontab from sourceforge. I am just wondering if anyone has any examples or useful links so that I can start with?
Thank you very much in advance!
Brian
Hello all,
I am trying to configure JBuilder to work with Weblogic 6.1. The problem is my Weblogic server is running on port "7011" and Jbuilder by default, starts the Weblogic server on port "7001". So I wonder if there is a way that I can change my Jbuilder so that it could work with Weblogic on port "7011"?
Thank you very much.
Brian.
Hello all,
I am trying to configure the JMS Server (Weblogic 6.1 + Oracle 9i OCI Connection)using JMS JDBC Store and I got the following error:
=========================================
ava.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:240)
at weblogic.jdbc.oci.Statement.executeUpdate(Statement.java:990)
at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:293)
at weblogic.jms.store.JDBCIOStream.changeState(JDBCIOStream.java:417)
at weblogic.jms.store.JDBCIOStream.setVersion(JDBCIOStream.java:1592)
at weblogic.jms.store.JDBCIOStream.open(JDBCIOStream.java:290)
at weblogic.jms.store.JMSStore.open(JMSStore.java:107)
at weblogic.jms.backend.BEPagingStore.open(BEPagingStore.java:107)
at weblogic.jms.backend.BackEnd.initialize(BackEnd.java:418)
at weblogic.jms.JMSService.createBackEnd(JMSService.java:907)
at weblogic.jms.JMSService.addJMSServer(JMSService.java:1274)
at weblogic.jms.JMSService.addDeployment(JMSService.java:1170)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java
===============================================
I wonder if anyone has any idea about it and how to fix it?
Thanks,
Brian
18 years ago
Hello everyone,
Have you ever heard about java package called twofish for security? What is it used for and where can I download it?
Thanks
Brian
18 years ago
Hello all,
I am trying to use DOM and XPath to develop a method that can append XML tags. For example:
Source:
< A >
< B > value </ B>
</ A >
Target:
< A >
< B > value </ B >
< B > value </ B >
</ A >
So here is my method:
public class MyXMLClass {
// Fields:
Documemt doc;
... // methods for initialize doc
public void appendXMLTag(String parentXPath, String childXPath)
throws TransformerException{
Node root = doc.getDocumentElement();
Node parent = XPathAPI.selectSingleNode(root, parentXPath);
Node child = XPathAPI.selectSingleNode(root, childXPath);
Node newChild = child.cloneNode(true);
parent.appendChild(newChild);
}
public static void main(Sting args[]){
MyXMLClass test = new MyXMLClass();
try {
... // call methods to initialzie doc
test.appendXMLTag("/A", "/A/B");
...
}
catch (Exception e) {
...
}
}
=======================
Now, the problem is when I use XPathAPI (see the code below) to access the appended node, I got null pointer exception.
...
Node root = doc.getDocumentElement();
Node node = XPathAPI.selectSingleNode(root,"/A/B[2]");
I guess my appendXMLTag method does not work probably. Do you know if there is a way to fix it?
Thank you very much.
Brian
Hello everyone,
I have seen from BEA web site, Quick Study for WLS-D21-6X-XX: Developing Enterprise Applications with Enterprise JavaBeans Using BEA WebLogic Server´┐Ż Version 6X. It is a self pace course for preparing Weblogic 6 Exam.
I wonder if there is anyone took the course before and how good it is in preparing for the exam.
Thanks,
Brian
Hi,
I am sorry to put my topic here but I think it's almost related to JSP . Here is the problem:
I define a javascript function in test.js file:
function testAlert(){
alert("testAlert");
}
In one of my html file callAlert.html, I call the function in the following:
< script src="test.js" > testAlert();
< /script >
How come that my callAlert.html doesn't pop up the alert?
Thanks,
Brian
18 years ago
JSP
Helle everyone,
I am new to XML technologies. I just have simple question, what is the difference between DTD and Schema?
Also, could you show me good tutorials from Internet about DTD and Schema as well as how to create them.
Thanks for your help,
Brian