Benjamin Ho

Greenhorn
+ Follow
since Nov 19, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Benjamin Ho

hi everybody,
Ko Ko Naing and Nicholas Cheung, thank you for your help.
Nicholas Cheung, I have tested and errors occured after coding like the following.
// [DELETE THIS]HttpServletResponse servletResponse=new HttpServletResponse();ServletEncoderHelper.encodeJPEG13(chart, 1.0f, response);
The error as:
ERROR [Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: getOutputStream() has already been called for this response
ERROR [Engine] ----- Root Cause -----
java.lang.IllegalStateException: getOutputStream() has already been called for this response
Ko Ko Naing, I think the doPost() method that would make me in bored state. I need time to think how to do the method. Anyway, Thank you for your suggestion.
best regards,
benjamin
[ March 09, 2004: Message edited by: Benjamin Ho ]
20 years ago
JSP
hi everybody,
hey, Nicholas Cheung and Jeroen Wenting, thank you for your suggestion. Since I am a beginner and dont know how to code servlet, i want to program the chart on JSP. Also the program is quickly handed, i have no time to study servlet.
Please tell me how to generate chart on jsp. Also I have coded the following but there are errors occured.
HttpServletResponse servletResponse=new HttpServletResponse();
ServletEncoderHelper.encodeJPEG13(chart, 1.0f, servletResponse);

The errors are 1. interface javax.servlet.http.HttpServletResponse is abstract; cannot be instantiated at line 62, constructor HttpServletResponse() not found in interface javax.servlet.http.HttpServletResponse at line 62.

How do I fix the bug?? Please tell me!!
best regards,
benjamin
20 years ago
JSP
hi everybody,
I met problems on generating chart by using jchart and jsp. the environment is with jCharts-0.7.0, j2sdk1.4.2_01, jbuilder development platform. there are the errors and code. The following are the errors:
ERROR [Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: getOutputStream() has already been called for this response
ERROR [Engine] ----- Root Cause -----
java.lang.IllegalStateException: getOutputStream() has already been called for this response
The following is the code:
<%@ page import="java.awt.*,org.jCharts.*,org.jCharts.chartData.*,org.jCharts.properties.*,org.jCharts.types.ChartType,org.jCharts.axisChart.*,org.jCharts.test.TestDataGenerator,org.jCharts.encoders.*,org.jCharts.properties.util.ChartFont"%>
<%
try
{
String[] xAxisLabels= { "2001", "2002", "2003", "2004", "2005", "2006", "2007" };
String xAxisTitle= "Models";
String yAxisTitle= "Unit Sold";
String title= "Product Sold";
DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle, title );
double[][] data= new double[][]{ { 300, 10, 200, 70, 140, 20, 10 } };
String[] legendLabels= { "quantity" };
Paint[] paints= new Paint[]{ Color.cyan.brighter() };
BarChartProperties barChartProperties= new BarChartProperties();
AxisChartDataSet axisChartDataSet= new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, barChartProperties );
dataSeries.addIAxisPlotDataSet( axisChartDataSet );
ChartProperties chartProperties= new ChartProperties();
//---to make this plot horizontally, pass true to the AxisProperties Constructor
//AxisProperties axisProperties= new AxisProperties( true );
AxisProperties axisProperties= new AxisProperties();
LegendProperties legendProperties= new LegendProperties();
//AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 550, 360 );
Chart chart=(Chart) new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, 550, 360 );
HttpServletReponse response=new HttpServletResponse();
ServletEncoderHelper.encodeJPEG13(chart, 1.0f, response);
//JPEGEncoder13.encode( chart, 1.0f, response );

} catch(Exception e)
{
System.out.println("this is the exception");
System.out.println(e);
}
%>
<html>
.....
</html>
Based on the above code, how to solve it if I need use jsp to program.
Urgent!! Please tell what happens and how to solve it!!
best regards,
benjamin
[ March 09, 2004: Message edited by: Benjamin Ho ]
[ March 09, 2004: Message edited by: Benjamin Ho ]
[ March 09, 2004: Message edited by: Bear Bibeault ]
20 years ago
JSP
hi everybody,
Do you have any ideas for generating report and chart?? please tell me! I am boring for generating report and chart for a long time.
The chart and report must be generated from analysing database and it can be integrated or embeded into JSP or may be involved with EJB. please tell me if you have any ideas and as well as the softwares or tools are free.
Best regards,
benjamin
20 years ago
hi everybody,
Do you have any ideas for generating report and chart?? please tell me! I am boring for generating report and chart for a long time.
The chart and report must be generated from analysing database and it can be integrated or embeded into JSP or may be involved with EJB. please tell me if you have any ideas and as well as the softwares or tools are free.
Best regards,
benjamin
20 years ago
hi everybody,
please help me to solve a problem. I am doing a test that a client calls a local entity bean but a client should call a remote session bean first then the session bean would call the local entity bean to insert a row information to mysql's database. The whole testing with many interfaces and class. All of them is successfully compiled and runs but there is no any change in database. But i sure the abstract accessor method's names that are same as field name with ejb-jar.xml and jbosscmp-jdbc.xml and database field's name.
In fact, what errors/problems existing on the program do you think.
Please tell me why and how to solve them.
Best regards,
Benjamin
hi everybody,
i have met a problem that a java breakpoint is often appeared on eclipse platform which i use to program ejb. the following is the content of java breakpoint:
Attempting to install a breakpoint in the type com.one.oneToMany.person.PersonBean$Proxy that has no line number attributes. The breakpoint cannot be installed. Class files must be generated with the line number attributes.
Reason:
Absent Line Number Information
That all of the content of java breakpoint. Does it relate to mysql's fields. Please tell me what happens and how to fix it.
Best regards,
Benjamin
[ November 26, 2003: Message edited by: Benjamin Ho ]
hi everybody,
hey, Brian Boyle, thank you for your suggestion. i have tried to test it. But I havent found service=Hypersonic when JBoss is started go to http://localhost:<port>/jmx-console. I dont know why? what happens? Would you mind telling me?
Best regards,
Benjamin
20 years ago
hi everybody,
i need your help. would you mind telling me what happens? i met an exception as "javax.naming.NameNotFoundException: SessionPersonHome not bound" when i run a program as client to call session bean.
the environment : In a folder as TestClient containing the following files or folders:
-TestPerson.java
-TestPerson.class
-jbossall-client.jar
-TestPersonEJB4.jar
Notice: TestPersonEJB4.jar including any folders with three classes as SessionPerson.class, SessionPersonHome.class, SessionPersonBean.class and a folder as META-INF containing jboss.xml, ejb-jar.xml
The command for running the client program as:
C:\ClientTest>java -classpath .;jbossall-client.jar;TestPersonEJB4.jar TestPerson
Then the output as the exception:
javax.naming.NameNotFoundException: SessionPersonHome not bound
Please tell me!! Thank you very much..
Best regards,
Benjamin
20 years ago
hi everybody,
i dont know why NoInitialContextException is occured when a client call a session bean.
The error shown in the following:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

The following is the source of client:
import javax.naming.Context;
import javax.naming.InitialContext;
import com.oneToMany.person.PersonRemote;
import com.oneToMany.person.PersonRemoteHome;
public class ClientTestPerson {
public static void main(String[] args) {
try{
Context ctx = new InitialContext();
Object ref = ctx.lookup("PersonRemoteHome");
PersonRemoteHome home = (PersonRemoteHome)javax.rmi.PortableRemoteObject.narrow(ref, PersonRemoteHome.class);
PersonRemote person = home.create();
person.setPersonInfo(1, "Yuk", "Lee", "Tom");
System.out.println("Already run client program");
}catch(Exception e){
System.out.println(e);
System.out.println("end of running exception");
}
}
}

Best regards,
Benjamin
20 years ago
hi everybody,
Can you tell me how to see what tables created in database as hypersonic.
the environment:
-j2ee 1.3
-jboss 3.2.X
Best regards,
Benjamin
20 years ago
hi everybody,
i have found a few errors when i compile the files. But a file as titan.jar is created and copy one on a directory $jboss_home\server\default\deploy after i have compiled the files.
The following is the error message.
23:27:09,593 ERROR [MainDeployer] could not create deployment: file:/C:/jboss/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/titan.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
23:27:09,603 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@2c81fc5d{ url=file:/C:/jboss/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/titan.jar, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
Please, tell me what happens and how to fix the problem
Best regards,
Benjamin
20 years ago
hi everybody,
i have configured the jboss.xml as the following:
<?xml version="1.0" encoding="UTF-8" ?>
- <jboss>
- <enterprise-beans>
- <entity>
<ejb-name>CustomerEJB</ejb-name>
<jndi-name>CustomerHomeRemote</jndi-name>
</entity>
</enterprise-beans>
</jboss>
the "jndi-name" as CustomerHomeRemote which is the home interface.
can you tell me what make error when i run the program? the question in above the reply....
Best regards,
Benjamin
20 years ago
hi everybody,
hey, norman richards thank you very much....
when i delete the "quiet=true", i can compile the files..
i have met a new problem when i run the program. Please tell me what happen? How to fix the error?
An error is:
C:\workbook\exAppendixA>client_61 777 Bill Burke 888 Sacha Labourey
Buildfile: build.xml
ejbjar:
run.client_61:
[java] javax.naming.NameNotFoundException: CustomerHomeRemote not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
a:261)
[java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
[java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
t.java:460)
[java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
ransport.java:701)
[java] at java.lang.Thread.run(Thread.java:534)
[java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
r(StreamRemoteCall.java:247)
[java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
ll.java:223)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:49
2)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:47
1)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at com.titan.clients.Client_61.main(Client_61.java:33)
BUILD SUCCESSFUL
Total time: 4 seconds
Best regards,
Benjarmin
20 years ago
hi everybody,
Thank you for each responder.
In fact, i am testing a sample in AppendixA of JBoss EJB Workbook. I have changed the database MySql to instead of Orcale.
I have met an error when i compile the ejb after configure all files needed. I have typed a command as 'ant' after a directory containing all files in the example. The following is the process of compiling the files.
C:\workbook\exAppendixA>ant
Buildfile: build.xml
prepare:
[mkdir] Created dir: C:\workbook\exAppendixA\build
[mkdir] Created dir: C:\workbook\exAppendixA\build\classes
compile:
[javac] Compiling 4 source files to C:\workbook\exAppendixA\build\classes
[javac] This version of java does not support the classic compiler; upgradin
g to modern
db:
[delete] Deleting: C:\jboss\jboss-3.2.1_tomcat-4.1.24\server\default\deploy\t
itandb-ds.xml
BUILD FAILED
file:C:/workbook/exAppendixA/build.xml:51: The <copy> task doesn't support the "
quiet" attribute.
Total time: 8 seconds

hey, can you tell what happen that? How to fix the bug? What is the "quiet" attribute?
Best regards,
Benjamin
20 years ago