Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Sherry Jacob

Ranch Hand
+ Follow
since Jun 29, 2005
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 Sherry Jacob

Hello friends...
I want some pointers to shutdown my operating system (Windows 2000) using Java code.

Is it possible or is it my weird thought ?

Suggessions and links are welcome.
16 years ago
I personally feel that preparing for the SCJP helps alot. I had worked for more than a year as a Java developer and had used Swing and core APIs during the development. But that was all through R&D and Googling.

Finally I decided 2 appear for SCJP 1.4 and believe me, there were lots of occasions when while preparing I found to my surprize...Oops !! I never knew that was possible through Java...and I never knew Java could be so powerful.

After appearing, though I did not fare according to my expectations, I found that I had gained alot about the language. Infact I have started loving Swing even more after that...though I am now involved with web development but I surely would love to be into Swing Development.

So yes, it has given me an enhanced toolbox to play with. The topics that really made me a more powerful programmer, were the Collection and Wrapper classes. They are certainly quite effective...sort of get u to do anything with anything in Java.

In the end, I felt that appearing for SCJP 1.4 was worth the try...at least on the conceptual aspect.

Originally posted by Shekhar Nathile:
i used VERTICAL_SCROLLBAR_ALWAYS & HORIZONTAL_SCROLLBAR_ALWAYS...but i need to show that vertical & horizontal scroll bar as in disabled state but it remain in enable state



Hi Shekhar,
Why go for that kind of stuff when you have a facility of using VERTICAL_SCROLLBAR_AS_NEEDED and HORIZONTAL SCROLLBAR_AS_NEEDED. That way you can make your application have scrollbars visible only when the size of the text in the JTextArea exceeds it's boundaries.

I feel thats a better way to implement Scrollbars in JTextArea.

Hope it helps.
16 years ago

Originally posted by shilpa patil:
Can anyone guide me about how can I add rows dynamically
into an already displayed table.

Thanks in advance
Shilpa




Hi Shilpa,
I've been trying to implement a dynamic JTable. But had some problems. I have posted my problem in this very forum.

Go through my code at :

https://coderanch.com/t/342592/GUI/java/JTable-ClassCastException-Add-rows-dynamically

Hope it gives u a start.
16 years ago
Hi Everyone,

Heres what I wrote to implement a simple JTable.



Can anyone tell me why this code gives a the following runtime error of ClassCastException?

---------- Run Java File ----------
java.lang.ClassCastException: java.lang.String
at javax.swing.table.DefaultTableModel.justifyRows(DefaultTableModel.java:238)
at javax.swing.table.DefaultTableModel.setDataVector(DefaultTableModel.java:194)
at TablePopulation.<init>(TablePopulation.java:36)
at TablePopulation.main(TablePopulation.java:49)
Exception in thread "main"
Output completed (3 sec consumed) - Normal Termination
[ March 17, 2006: Message edited by: Sherry Jacob ]
16 years ago
Hi Dave,
Thannks for the enlightemnent on the subject. It was quite helpful. But there are a few more clarifications I'd like to make.

Surely you dont need a full EJB capable J2EE container, in fact you dont need servlets/jsps/webserver.

I understand that I do not need a full EJB capable J2EE container. But what do you think about yahoo messenger ? It does have a client web-interface too where a user registers onto a main database obviously. That's where I also thought of the need for JSP/Servlets. How else could I maintain a list of users for the application within the office ?


...there are several ways of sending messages to & from other instances of your application, and storing them you can just use some lightweight database like hsqldb.

I know that I can develop a completely Swing-based application too. But the minimum application implementation requirements are Swing, JSP/Servlets with MySQL database. Any pointers here ?


...intrusive complexity EJB's will add to your project.

I understand that EJBs will add complexity overhead that's why I decided to keep EJBs optional.

So how should I go about it now ?
16 years ago
Hello friends,
I am planning to make a small project. What I plan is a yahoo-messenger type of application for an inter-office communication purpose.

I plan to do this using Swing, EJBs and JSP/Servlets.

Is it possible to interact Swing with EJBs because that's the actual requirement of the project.

Any pointers as to how I should go about it ?

Thanks alot.
16 years ago
I made a simple swing application and packaged it in the same directory by the name MyJAR.jar.

Using the jar command on the command line, this is what i got:
D:\java_programs\swingClass>jar cvf D:\java_programs\swingClass\MyJAR.jar D:\java_programs\swingClass\*.*
added manifest
adding: D:/java_programs/swingClass/MySwingClass.class(in = 1153) (out= 680)(def
lated 41%)
adding: D:/java_programs/swingClass/MySwingClass.java(in = 705) (out= 355)(defla
ted 49%)

The JAR is created successfully in the same folder.

However, when I try to run the jar directly, I get the following:

D:\java_programs\swingClass>java -jar MyJAR.jar
Failed to load Main-Class manifest attribute from
MyJAR.jar

Why is this happening ? Any clues ? Am I missing something ?
Please guide.
16 years ago

Originally posted by Roger Chung-Wee:
What happens if you try to redeploy your EAR file?



It gives nothing and simply shows a deployed status.
I don't know if this is the right place to post this question. Any help would be appreciated.

I am using Sun's J2EE Reference Implementation server 1.4 to deploy my web applications.

I made and deployed a simple web application in an Enterprise Archive as myEAR.ear.

Everything went fine and the application deployed and worked correctly. However, by mistake, I forgot to undeploy the application from the server and deleted the myEAR.ear file from its location.

Now, everytime I try to create another application by the name myEAR.ear, it gives the following error:


stop: myEAR
Running...
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: myEAR not found; nested exception is:
javax.management.InstanceNotFoundException: myEAR not found

at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:61)

at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)

at org.omg.stub.com.sun.enterprise.tools.deployment.backend._JarInstaller_Stub.stop(Unknown Source)

at com.sun.enterprise.deployapi.actions.ModuleStateAction.run(ModuleStateAction.java:61)

at java.lang.Thread.run(Thread.java:536)

Caused by: java.rmi.RemoteException: myEAR not found; nested exception is:
javax.management.InstanceNotFoundException: myEAR not found

at com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.stop(JarInstallerImpl.java:1286)

at org.omg.stub.com.sun.enterprise.tools.deployment.backend._JarInstallerImpl_Tie._invoke(Unknown Source)

at com.sun.corba.se.internal.corba.ServerDelegate.dispatch(ServerDelegate.java:352)

at com.sun.corba.se.internal.iiop.ORB.process(ORB.java:252)

at com.sun.corba.se.internal.iiop.RequestProcessor.process(RequestProcessor.java:81)

at com.sun.corba.se.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:106)

Caused by: javax.management.InstanceNotFoundException: myEAR not found

at com.sun.enterprise.management.util.J2EEManagementObjectManager.getManagedObjectModule(J2EEManagementObjectManager.java:672)

at com.sun.enterprise.management.util.J2EEManagementObjectManager.stopModule(J2EEManagementObjectManager.java:639)

at com.sun.enterprise.tools.deployment.backend.JarInstallerImpl.stop(JarInstallerImpl.java:1276)

... 5 more



!!! Operation Failed !!!

**********************************************************************
[Completed (time=1.2sec, status=13)]
**********************************************************************


Also, the application shows a status of being deployed on the server. I am unable to undeploy/stop or remove it as everytime I get the above error.

I tried to delete all possible entries on my hard drive pertaining to myEAR.ear. But the problem still persists.

Is there a way to solve this problem ?

Please help.

Thanks.
This is a rather basic question related to packages but somehow I tend to forget how it is done.

I have the following hierarchy on my Win2K desktop.

D:/Documents and Settings/Administrator/Desktop/JavaTrial
D:/Documents and Settings/Administrator/Desktop/JavaTrial/package1

The sub-folder package1 has a file named PClass.java which is as follows:
package package1;
import java.io.*;



The folder JavaTrial has a single java file named MyMainClass.java which is as follows :


So I am trying to call a class within package1 from outside it.

However, when I compile the files, PClass.java compiles without errors while compiling MyMainClass.java gives the following errors:

---------- Compile Java File ----------
MyMainClass.java:2: package package1 does not exist
import package1.*;
^
MyMainClass.java:13: package package1 does not exist
package1.PClass obj = new package1.PClass();
^
MyMainClass.java:13: package package1 does not exist
package1.PClass obj = new package1.PClass();
^
3 errors

It says package1 does not exist. Why ? Whats wrong ?

Please help.
Thanks
16 years ago

Originally posted by Dave Salter:
I think your class needs to be in a package. I've encountered similar problems when servlet classes are not in packages.



Thanks for the time Dave. But hey, I learned that the entire web-application is to be packaged into a WAR file which I am doing before I deploy.

Which class are you talking about and which package ?

Thanks again
16 years ago

Originally posted by Manoj Zachariah:
Deployment failed on target localhost:4848_server : Fatal Error from EJB Compiler -- rmic compilation failed



Have you set the CLASSPATH and PATH system variables correctly ?

This is probably an error because your server isn't recognizing the required JARs at compile time.
I installed Sun J2EE RI server on my system as D:\j2sdkee1.4
I have JDK1.4 also on my system at D:\jdk1.4.0_03

This is my classpath:
D:\j2sdk1.4.0_03\lib\tools.jar;D:\j2sdk1.4.0_03\jre\lib\rt.jar;D:\j2sdk1.4.0_03\jre\lib\ext\servlets-common.jar;D:\j2sdk1.4.0_03\jre\lib\ext\servlets-invoker.jar;D:\j2sdk1.4.0_03\jre\lib\ext\servlets-default.jar;D:\j2sdk1.4.0_03\jre\lib\ext\servlets-webdav.jar;

and this is the PATH : %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\j2sdk1.4.0_03\bin;D:\Ant\bin;

I created a simlple web application with an index.html and an index.jsp file according to the tutorial.

I deployed it correctly. But when I type the application's URL in the address bar, the index.html file is served perfectly.

However, the index.jsp file shows this error :


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.util.SecurityUtil$1.run(SecurityUtil.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:499)
at org.apache.catalina.util.SecurityUtil.execute(SecurityUtil.java:210)
at org.apache.catalina.util.SecurityUtil.doAsPrivilege(SecurityUtil.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:99)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:271)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:532)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:383)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)


root cause

java.lang.NoClassDefFoundError
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:213)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:409)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:570)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.util.SecurityUtil$1.run(SecurityUtil.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:499)
at org.apache.catalina.util.SecurityUtil.execute(SecurityUtil.java:210)
at org.apache.catalina.util.SecurityUtil.doAsPrivilege(SecurityUtil.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:99)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:271)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:532)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:383)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)



--------------------------------------------------------------------------------

Apache Tomcat/5.0

I also tried running the j2ee-admin tool by typing http://localhost:8000/j2ee-admin and it shows the same exception.

What's the problem ?

Please help.
[ January 07, 2006: Message edited by: Sherry Jacob ]

Originally posted by A Kumar:
Hi,

Check in jboss/server.default/lib...

there are 2 files javax.servlet & javax.servlet.jsp


Regards



Thanks alot...ur advice helped
16 years ago