Sham Grandhe

Ranch Hand
+ Follow
since Dec 16, 2003
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Sham Grandhe

Originally posted by sandeep mittal:
telnet <serverName> 1433
what is the use of this command at telenet

i write this on console
and i got only cursor blinks what does this show
what is the use of this command
and what we are checking through this



waw check the above mentioned steps you should be able to resolve the issue.
hey use the below link to change your SQL Server Login setting from window authentication to SQL Server and Window Authentication

http://www-1.ibm.com/support/docview.wss?uid=swg21119906

this might help your resolve the SQL Server Error 18452
Hi Bibeault,

If your class is not being found it is either because there's an error in your setup



To ensure that the setup is fine I have put some other simple sevlets and jsp and checked.

the class isn't really there, or the exception is not for the class that you think it is.



To ensure this I have opened the jar and check it, the file exists.

If you feel this is not correct, can you please advise me as of what is to be done.

Thank you,

Sham
12 years ago
JSP
Hi,

In one of my JSP I have extended a custom servlet class which is available from the jars which are located in my lib folder, when the JSP's servlet gets executed it says that class is not available how do I set the class path for those files.

Any suggestions appreciated

Thank you,


java.lang.NoClassDefFoundError
at com.pennywise.framework.mvc.Jsp.process(Jsp.java:65)
at com.pennywise.framework.mvc.Jsp.service(Jsp.java:49)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)



Sham
[ November 19, 2005: Message edited by: kumar shyam ]
12 years ago
JSP
Hi Friends,
This is Sham, iam working on a project, with similar framework as that of struts.
The problem that iam facing is that, i have two submit button one for moving back in an application flow and the other for moving forward. On hitting enter in the mid way of fill an application by default the back button is striked i want to strike the continue button by default.

Thank you in advance,

regards
Sham
Hi Gregg,

Iam actually trying to show a flash file in swing components, so ive downloaded this coded from the sun site, iam able to run but unable to play the files



/*
* @(#)MDIApp.java 1.3 01/03/13
*
* Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
*
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
*/

import javax.media.*;
import com.sun.media.ui.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.util.Vector;

public class MDIApp extends Frame {

/*************************************************************************
* MAIN PROGRAM / STATIC METHODS
*************************************************************************/

public static void main(String args[]) {
MDIApp mdi = new MDIApp();
}

static void Fatal(String s) {
MessageBox mb = new MessageBox("JMF Error", s);
}

/*************************************************************************
* VARIABLES
*************************************************************************/

JMFrame jmframe = null;
JDesktopPane desktop;
FileDialog fd = null;
CheckboxMenuItem cbAutoLoop = null;
Player player = null;
Player newPlayer = null;
String filename;

/*************************************************************************
* METHODS
*************************************************************************/

public MDIApp() {
super("Java Media Player");

// Add the desktop pane
setLayout(new BorderLayout());
desktop = new JDesktopPane();
desktop.setDoubleBuffered(true);
add("Center", desktop);
setMenuBar(createMenuBar());
setSize(640, 480);
setVisible(true);

try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (Exception e) {
System.err.println("Could not initialize java.awt Metal lnf");
}
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});

Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
}

private MenuBar createMenuBar() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
String command = ae.getActionCommand();
if (command.equals("Open")) {
if (fd == null) {
fd = new FileDialog(MDIApp.this, "Open File", FileDialog.LOAD);
fd.setDirectory("/movies");
}
fd.show();
if (fd.getFile() != null) {
String filename = fd.getDirectory() + fd.getFile();
openFile("file:" + filename);
}
} else if (command.equals("Exit")) {
dispose();
System.exit(0);
}
}
};

MenuItem item;
MenuBar mb = new MenuBar();
// File Menu
Menu mnFile = new Menu("File");
mnFile.add(item = new MenuItem("Open"));
item.addActionListener(al);
mnFile.add(item = new MenuItem("Exit"));
item.addActionListener(al);

// Options Menu
Menu mnOptions = new Menu("Options");
cbAutoLoop = new CheckboxMenuItem("Auto replay");
cbAutoLoop.setState(true);
mnOptions.add(cbAutoLoop);

mb.add(mnFile);
mb.add(mnOptions);
return mb;
}

/**
* Open a media file.
*/
public void openFile(String filename) {
String mediaFile = filename;
Player player = null;
// URL for our media file
URL url = null;
try {
// Create an url from the file name and the url to the
// document containing this applet.
if ( (url = new URL(mediaFile)) == null) {
Fatal("Can't build URL for " + mediaFile);
return;
}

// Create an instance of a player for this media
try {
player = Manager.createPlayer(url);
} catch (NoPlayerException e) {
Fatal("Creating the Player Error: " + e);
}
} catch (MalformedURLException e) {
Fatal("MalformedURLException Error:" + e);
} catch (IOException e) {
Fatal("IOException Error:" + e);
}
if (player != null) {
this.filename = filename;
JMFrame jmframe = new JMFrame(player, filename);
desktop.add(jmframe);
}
}
}

class JMFrame extends JInternalFrame implements ControllerListener {
Player mplayer;
Component visual = null;
Component control = null;
int videoWidth = 0;
int videoHeight = 0;
int controlHeight = 30;
int insetWidth = 10;
int insetHeight = 30;
boolean firstTime = true;

public JMFrame(Player player, String title) {
super(title, true, true, true, true);
getContentPane().setLayout(new BorderLayout());
setSize(320, 100);
setLocation(50, 50);
setVisible(true);
mplayer = player;
mplayer.addControllerListener( (ControllerListener)this);
mplayer.realize();
addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameClosing(InternalFrameEvent ife) {
mplayer.close();
}
});

}

public void controllerUpdate(ControllerEvent ce) {
System.out.println("1: Entered the Controller event: ");
if (ce instanceof RealizeCompleteEvent) {
mplayer.prefetch();
System.out.println("2: Entered the Controller event prefetch: ");
} else if (ce instanceof PrefetchCompleteEvent) {
if (visual != null) {
System.out.println("return: ");
return;
}

if ( (visual = mplayer.getVisualComponent()) != null) {
Dimension size = visual.getPreferredSize();
videoWidth = size.width;
videoHeight = size.height;
getContentPane().add("Center", visual);
System.out.println(
"3: Entered the Controller event getVisualcomponent is not null: ");
} else {
videoWidth = 320;
System.out.println("3: Entered the Controller event video width set: ");
}
if ( (control = mplayer.getControlPanelComponent()) != null) {
controlHeight = control.getPreferredSize().height;
getContentPane().add("South", control);
System.out.println(
"4: Entered the Controller event getControlPanelComponent not null: ");
}
setSize(videoWidth + insetWidth,
videoHeight + controlHeight + insetHeight);
validate();
mplayer.start();
} else if (ce instanceof EndOfMediaEvent) {
System.out.println(" 5: this is in the start mplayer: ");
mplayer.setMediaTime(new Time(0));
mplayer.start();
}
}
}



Unable to handle format: MPEG, 352x240, FrameRate=29.9, Length=126720

Unable to handle format: mpegaudio, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 28000.0 frame rate, FrameSize=32768 bits


plz help me to sort out the problem.


regards

sham
[ March 11, 2005: Message edited by: kumar shyam ]
12 years ago
Hi Friends,

Iam actually trying to show a flash file in swing components, so ive downloaded this coded from the sun site, iam able to run but unable to play the files



/*
* @(#)MDIApp.java1.3 01/03/13
*
* Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
*
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
*/

import javax.media.*;
import com.sun.media.ui.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.util.Vector;

public class MDIApp extends Frame {

/*************************************************************************
* MAIN PROGRAM / STATIC METHODS
*************************************************************************/

public static void main(String args[]) {
MDIApp mdi = new MDIApp();
}

static void Fatal(String s) {
MessageBox mb = new MessageBox("JMF Error", s);
}

/*************************************************************************
* VARIABLES
*************************************************************************/

JMFrame jmframe = null;
JDesktopPane desktop;
FileDialog fd = null;
CheckboxMenuItem cbAutoLoop = null;
Player player = null;
Player newPlayer = null;
String filename;

/*************************************************************************
* METHODS
*************************************************************************/

public MDIApp() {
super("Java Media Player");

// Add the desktop pane
setLayout(new BorderLayout());
desktop = new JDesktopPane();
desktop.setDoubleBuffered(true);
add("Center", desktop);
setMenuBar(createMenuBar());
setSize(640, 480);
setVisible(true);

try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (Exception e) {
System.err.println("Could not initialize java.awt Metal lnf");
}
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});

Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
}

private MenuBar createMenuBar() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
String command = ae.getActionCommand();
if (command.equals("Open")) {
if (fd == null) {
fd = new FileDialog(MDIApp.this, "Open File", FileDialog.LOAD);
fd.setDirectory("/movies");
}
fd.show();
if (fd.getFile() != null) {
String filename = fd.getDirectory() + fd.getFile();
openFile("file:" + filename);
}
} else if (command.equals("Exit")) {
dispose();
System.exit(0);
}
}
};

MenuItem item;
MenuBar mb = new MenuBar();
// File Menu
Menu mnFile = new Menu("File");
mnFile.add(item = new MenuItem("Open"));
item.addActionListener(al);
mnFile.add(item = new MenuItem("Exit"));
item.addActionListener(al);

// Options Menu
Menu mnOptions = new Menu("Options");
cbAutoLoop = new CheckboxMenuItem("Auto replay");
cbAutoLoop.setState(true);
mnOptions.add(cbAutoLoop);

mb.add(mnFile);
mb.add(mnOptions);
return mb;
}

/**
* Open a media file.
*/
public void openFile(String filename) {
String mediaFile = filename;
Player player = null;
// URL for our media file
URL url = null;
try {
// Create an url from the file name and the url to the
// document containing this applet.
if ( (url = new URL(mediaFile)) == null) {
Fatal("Can't build URL for " + mediaFile);
return;
}

// Create an instance of a player for this media
try {
player = Manager.createPlayer(url);
} catch (NoPlayerException e) {
Fatal("Creating the Player Error: " + e);
}
} catch (MalformedURLException e) {
Fatal("MalformedURLException Error:" + e);
} catch (IOException e) {
Fatal("IOException Error:" + e);
}
if (player != null) {
this.filename = filename;
JMFrame jmframe = new JMFrame(player, filename);
desktop.add(jmframe);
}
}
}

class JMFrame extends JInternalFrame implements ControllerListener {
Player mplayer;
Component visual = null;
Component control = null;
int videoWidth = 0;
int videoHeight = 0;
int controlHeight = 30;
int insetWidth = 10;
int insetHeight = 30;
boolean firstTime = true;

public JMFrame(Player player, String title) {
super(title, true, true, true, true);
getContentPane().setLayout(new BorderLayout());
setSize(320, 100);
setLocation(50, 50);
setVisible(true);
mplayer = player;
mplayer.addControllerListener( (ControllerListener)this);
mplayer.realize();
addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameClosing(InternalFrameEvent ife) {
mplayer.close();
}
});

}

public void controllerUpdate(ControllerEvent ce) {
System.out.println("1: Entered the Controller event: ");
if (ce instanceof RealizeCompleteEvent) {
mplayer.prefetch();
System.out.println("2: Entered the Controller event prefetch: ");
} else if (ce instanceof PrefetchCompleteEvent) {
if (visual != null) {
System.out.println("return: ");
return;
}

if ( (visual = mplayer.getVisualComponent()) != null) {
Dimension size = visual.getPreferredSize();
videoWidth = size.width;
videoHeight = size.height;
getContentPane().add("Center", visual);
System.out.println(
"3: Entered the Controller event getVisualcomponent is not null: ");
} else {
videoWidth = 320;
System.out.println("3: Entered the Controller event video width set: ");
}
if ( (control = mplayer.getControlPanelComponent()) != null) {
controlHeight = control.getPreferredSize().height;
getContentPane().add("South", control);
System.out.println(
"4: Entered the Controller event getControlPanelComponent not null: ");
}
setSize(videoWidth + insetWidth,
videoHeight + controlHeight + insetHeight);
validate();
mplayer.start();
} else if (ce instanceof EndOfMediaEvent) {
System.out.println(" 5: this is in the start mplayer: ");
mplayer.setMediaTime(new Time(0));
mplayer.start();
}
}
}



Unable to handle format: MPEG, 352x240, FrameRate=29.9, Length=126720

Unable to handle format: mpegaudio, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 28000.0 frame rate, FrameSize=32768 bits



can someone plz help me to sort out the problem.


regards

sham
12 years ago
Hi Friends,

iam dragging with a problem from quite a few days, on how to show flash file in swing components. can some on please help me out.

regards

sham
12 years ago
Hi Friends,

I have small problem with the JEditor Pane can some one help, the problem is that I want to view the HTML page from a specified offset with the editor pane.
Thank you

regards
sham
12 years ago
Hi Sainath,

indreasing the width of the scrollbar is a very long process ill just tell how try this out.

first you have to create the an inner class for the BasicComboxUI and them for the BasicComboPopup there you have to implement the createScroller method, in which u'll have to create scrollPane for which again u'll have implement a BasicScrollPaneUI. in which you have to again implement the BasicScrollBarUI for which you have to write the paintTrack() method there you have to se the rectangle bounds then ull get that. best of luck


regards
sham
[ February 26, 2005: Message edited by: kumar shyam ]
12 years ago
Hi Friends,
when iam trying to set the panels border as round border it does not appear round. the resulting outline remains rectangle. plz do help me.
Thank you

regards
sham
12 years ago
Hi Friends,
Is there any possability to set different sides of the line border with different Colors, if so plz do put sth here.
Thank you,

regards
sham
12 years ago
hi Craig Wood,
Thank you, your example will help me a lot.

regards
sham
12 years ago
Hi Friends,
Iam presently working on a swings project and want to resize an Icon that is being placed on a button or a label. can some one plz help to do this.

Thank you

regards
sham
12 years ago
Hi JayaSiji Gopal,
hope you have not gone through the program properly. check out one and if you dont get then compile the prog so that you could get the answer for your question. and if u dont get than also you should read the inner class. since its easy i leave this for you.

best of luck

regards
sham