Images as Hyperlinks independant of Tomcat server
we are trying to use images as hyperlinks without deploying the images to Tomcat in Web Intelligence. What exactly I am looking for is to either write a code that allows me to do so or place the image folder outside of Tomcat.
Any idea or help will be appreciated.
Hi Fahid,
You can try the below steps which are pretty simple. It worked fine for me. For this I used an image object placed in ROOT directory of a web application server.
1.
Add a blank cell
2.
Right-click on the blank cell and select “Format cell”
3.
Under “General” specify Read content as “Hyperlink”
4.
Apply >> OK
5.
Right click on the cell >> "Edit Formula" >> Use the following formula
="<html><a href='http://localhost:8080' target='_blank'><img src = 'http://localhost:8080/sample.png' /></a></html>"
Hope this helps.
Regards,
Niraj
Similar Messages
-
Reloading a new JSP/Jar in Tomcat Server
HI,
I face these problems now.
My environment is Oracle Jdev 3.2.3 for JSP development. Tomcat4.0.1 as Application server plugged into IIS webserver and Using oracle 8i as the database
1. Whenever I update my JSP's and Application jar files, I copy from staging area to the deployment Tomcat Server application specific directories. The files are getting copied(overwritten). After that when i try to access my context/application in Tomcat server, my browser simply tries to browse and doesn't bring up the homepage of my application(say index.jsp).
I need to stop the tomcat server and restart again. Then I get it.
Is there anyone who came across this error and possibly help me to solve this?
2. I have a JSP (say emplist) which shows all the employees details with empno, ename, depyno and sal as 4 columns.
I have a up and down arrow images near the column names. Upon clicking it, it will call the same page and sort the column either desc or asc based on the previous display order. The column on which the Arrow button displayed is stored in session variable.
This sorting in JSP perfectly works in JDeveloper and when i run using WebToGo Server. But when i deployed in Tomcat,This sorting doesn't work.
The page simply stands. and when i go back and front browsing my other pages of application, i lose the position of the arrow button and it behaves unexpectedly by showing up in some other columns.
is there any reason for this kind of behaviour?
3. In my JSP files, I log the user actions into a text file in the server. IN WTG, I am able to specify the path of the output directory.
But in Tomcat Server, by default the output files are getting created in C:/Tomcat/bin directory.
I donno how to set an output directory, where the files will be written to and set an input directory from where my custom application properties files will be read from.
Can anyone help me in telling in which file and what attributes, i need to set the input and output directory path in Tomcat Server?
Can someone help me in giving suggestions or solutions for the above problems?
Thanks a lot in advance.
Thanks
HariI added a Context Tag in server.xml file in the Host Tag
<Context docBase="struts-blank">
</Context>and so following comes up in the Server Console Window
INFO: Starting service Catalina
Feb 7, 2005 11:06:30 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.2
Feb 7, 2005 11:06:30 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:396)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardConte
xt.java:3707)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
934)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:420
at org.apache.catalina.core.StandardService.start(StandardService.java:4
50)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:196
7)
at org.apache.catalina.startup.Catalina.start(Catalina.java:541)
... 6 moreThanks in advance
CSJakharia -
Revision: 939
Author: [email protected]
Date: 2008-03-26 13:35:44 -0700 (Wed, 26 Mar 2008)
Log Message:
Bug: BLZ-67 - Should turn off session persistence in the Tomcat server we ship.
QA: No
Doc: No
Checkintests: Pass
Details - Turning off session persistence in the version of Tomcat that ships with BlazeDS. We don't store much in the session so session persistence doesn't make much sense for us. Users should feel free to turn this back on if they feel they need it.
Ticket Links:
http://bugs.adobe.com/jira/browse/BLZ-67
Modified Paths:
blazeds/branches/3.0.x/servers/apache-tomcat-6.0.14/conf/context.xmlHi, thank you for your replies, I found out few things about my servlet, and its portability
and i have few questions, although i marked this topic as answered i guess its ok to post
I am using javax.servlet.context.tempdir to store my files in that servletcontext temporary directory. But i dont know how to give hyperlink
of the modified files to the user for them to download the modified files.
What i am using to get the tempdir i will paste
File baseurl = (File)this.getServletContext().getAttribute("javax.servlet.context.tempdir");
System.out.println(baseurl);
baseurl = new File(baseurl.getAbsolutePath()+File.separator+"temp"+File.separator+"files");
baseurl.mkdirs();so i am storing my files in that temp/files folder and the servlet processes them and modifies them, then how to present them as
links to the user for download ?
and as the servlet is multithreaded by nature, if my servlet gets 2 different requests with same file names, i guess one of them will be overwritten
And i want to create unique directory for each request made to the servlet , so file names dont clash.
one another thing is that i want my servlet to be executed by my <form action> only, I dont want the user to simply type url and trigger the servlet
Reply A.S.A.P. please..
Thanks and regards,
Mihir Pandya -
Tomcat Server Closes with JFrame Application
When I open my JFrame Application, and decide to close it this application of mine closes together with my tomcat server... I suspect is the "System.exit(0);" in my JFrame application that causes it.
Can anyone tell me what I should do to my JFrame application so when I closes it, it will not close my Tomcat server at the same time.
Thank You : )
Regards,
RainbowEnergiesIt probably is the System.exit(0); You should remove that.
Tomcat is a container which essentially means it's a sort of "main program" that calls your servlets, JSP programs, etc. as "subroutines". When a subroutine calls "exit", the main program will shutdown.
If you need the JFrame to "exit" when it's being run independently of Tomcat, move the System.exit() call to the "public static void main()" method. Tomcat will never call your class's "main" method, since it uses its own. -
Regarding Tomcat Server Error/Warnings
Hi there,
I am getting some errors/warnings on the Tomcat server screen...
Actually, I am using a Controller Servlet and every request is being passed thru this servlet. There are some images on the Home page (Home.jsp) but when the Home link is clicked, these images disappear....
What do these error/warnings mean?
2002-04-03 12:42:52 - Ctx( /9001 ): IllegalStateException in: R( /9001 + /Home.jsp + null) Cannot forward as OutputStream or Writer has already been obtained
2002-04-03 12:42:52 - Ctx( /9001 ): 404 R( /9001 + /servlet/getacro.gif + null)null
2002-04-03 12:42:52 - Ctx( /9001 ): 404 R( /9001 + /servlet/getie.gif + null) null
2002-04-03 12:43:04 - Ctx( /9001 ): IllegalStateException in: R( /9001 + /Contact.jsp + null) Cannot forward as OutputStream or Writer has already been obtained
Any help would be much appreciated
Thanks!!!I believe this means that the JSP has already committed to sending data to the output stream, so it can no longer do a redirect or forward. If you have redirect or forward logic in your page, you should execute it before you write any data to the output stream. This means it needs to be the first thing in the page before any html is written.
-
Problem when mounting tomcat server for upgrading ACS
Hi:
I've downloaded the Appliance Management package for 4.1.1.23 version. Once I extract all archives I execute the autorun.bat file. The problem is that the tomcat server doesn't work properly, continuously appears a message error:
INFO: WebServer not ready or not fully initialized -- testing again...
Which can be the problem?,
Many ThanksUpgrading the Cisco Secure ACS Solution Engine typically involves the following three steps:
1. Obtain the upgrade package from Cisco Systems and load it onto a distribution server in your network. This can be done either by employing an upgrade CD or downloading the upgrade package from Cisco.com.
2. Load the upgrade image onto the Cisco Secure ACS Solution Engine from the distribution server on your network. You can do this either from within the HTML interface, or from the serial console. The Cisco Secure ACS Solution Engine verifies the files transferred to ensure that they have not been corrupted. For more information on performing this step from the HTML interface, see the below URL:
http://www.cisco.com/en/US/products/sw/secursw/ps5338/products_user_guide_book09186a0080204be1.html
3. Finally, apply the Cisco Secure ACS Solution Engine system upgrade. You can do this either from within the HTML interface, or from the serial console. For more information, see:
http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_server_for_solution_engine/3.3/installation/guide/appliance/admap.html#wp1048998 -
TOMCAT SERVER CONNECTED TO LOAD BALANCER
Hi ,
scenario:
Tomcat server addedd to the load balancer for performance .
Q&A:
We have added tomcat(new server) to load balancer,now all the services are up and running,but i want to know the validation of how the new server added to the cluster will have the connections via load balancer to this server. is there any simple way where by we can go by looking at some logs, or load, or connection statistics for the Tomcat server whilst users connect.
please gurus can you help,
1.HOW TO VALIDATE THE LB IS WORKING FINE .
2.TOMCAT SERVICES VIA LB (CONNECTION)
3.OTHER VALIDATION TO BE CONSIDERED.
Regards,SAP Business Objects really cannot verify if your load balancer is working fine, you should take that up with your load balancer manufacturer or IT folks that manage it.
When using a load balancer with business objects deployment on tomcat you should enable session persistance (this is mandatory in XIR2) and may be needed in some circumstances in XI 3.x.
A little trick I've seen customers do is to change an image file in the deployment to have a #1 or 2 or 3 or... depending on the tomcat server, this way they could tell which server the load balancer was redirecting to. To do this right click the image when accessing tomcat (to get it's location in the deployment) and simply edit with MS paint or favorite image editor (back up the original 1st just in case...)
Regards,
Tim -
Stopping the player at the client machine independent of the server playing
can anyone help me i need to allow the client to stop a player independent of the server transmitting the movie. can anyone help me plz!!
here are rhe codes for the client and the client gui
import javax.swing.*;
import javax.swing.UIManager;
import java.awt.*;
import java.awt.event.*;
public class ClientChoice
public static void main(String args[])
try
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
catch(Exception e)
}//main
JFrame frame=new JFrame("--- New Line Movie ---");
//Create the menu bar
JMenuBar menuBar;
JMenu menu;
menuBar = new JMenuBar();
//Build the file menu in the menu bar
menu = new JMenu("File");
menu.setMnemonic(KeyEvent.VK_F);
menuBar.add(menu);
JMenuItem menuItem= new JMenuItem("Exit",KeyEvent.VK_X);
menuItem.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
System.exit(0);
menu.add(menuItem);
//Build help menu in the menu bar.
menu = new JMenu("Help");
menu.setMnemonic(KeyEvent.VK_H);
menuBar.add(menu);
JMenuItem help_item=new JMenuItem("Help Topics",KeyEvent.VK_T);
menu.add(help_item);
JMenuItem about_item=new JMenuItem("About Us");
menu.add(about_item);
frame.setJMenuBar(menuBar);
ImageIcon icon=new ImageIcon("images/potter.jpg","");
JButton clickmovie=new JButton(icon);
//final JLabel latest=new JLabel("<html><caption>Harry Potter</caption></html>");
//clickmovie.add(latest);
final JLabel welcome1=new JLabel("<html><font color=blue face=arial size=3><strong>New Line Movie</strong> gives you the possibility to view your favorite movies.<br>You can choose your category of movies below and click on any movie to get more information about it. <br>Latest News about new movies are also available. ENJOY!!!</font></html>");
frame.getContentPane().add(welcome1,BorderLayout.EAST);
final JLabel copyright=new JLabel("<html><font color=blue face=arial size=3><p align=center>© Copyright 2004</p></font></html>");
//frame.getContentPane().add(copyright,BorderLayout.EAST);
JPanel actionPanel=new JPanel();
JPanel cartoonPanel=new JPanel();
JPanel comedyPanel=new JPanel();
JPanel fictionPanel=new JPanel();
JPanel mainPanel=new JPanel();
mainPanel.setLayout(new GridLayout(2,1,5,5));
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
mainPanel.add(actionPanel);
mainPanel.add(cartoonPanel);
mainPanel.add(comedyPanel);
mainPanel.add(fictionPanel);
//mainPanel.add(copyright);
actionPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Action"),BorderFactory.createEmptyBorder(5,5,5,5)));
cartoonPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Cartoon"),BorderFactory.createEmptyBorder(5,5,5,5)));
comedyPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Comedy"),BorderFactory.createEmptyBorder(5,5,5,5)));
fictionPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Science Fiction"),BorderFactory.createEmptyBorder(5,5,5,5)));
frame.getContentPane().add(mainPanel,BorderLayout.SOUTH);
frame.getContentPane().add(clickmovie,BorderLayout.WEST);
// Create combo box with action movies choices
final JComboBox actionChoices;
String[] actionmovie={"-Select a movie-","X-Men","Spiderman"};
actionChoices=new JComboBox(actionmovie);
actionChoices.setSelectedIndex(0);
actionPanel.add(actionChoices);
actionChoices.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
JComboBox cb = (JComboBox)e.getSource();
String act = (String)cb.getSelectedItem();
if(act=="X-Men")
JFrame action_xmen= new JFrame("--- New Line Movie: X-Men --- ");
action_xmen.setSize(400,350);
JPanel main=new JPanel();
main.setLayout(new GridLayout(2,1,5,5));
main.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
ImageIcon icon_men=new ImageIcon("images/x-men.jpg","");
JButton clickmovie_men=new JButton(icon_men);
final JLabel xmen_overview=new JLabel("<html><font color=blue face=arial size=3><b>Title:</b></font> <font color=black><strong>X-Men 2 </strong></font> <br><br><font color=blue face=arial size=3><b>Starring:</b> Hugh JACKMAN and Halle BARRY<br><br><b>Story:</b> The time has come for those who are different to stand united. <br><br>A military officer with a link to Wolverine's mysterious past conspires <br><br>to eradicate the mutant population for once and all. In order to defeat <br><br>this new menace, the X-men will be forced to join forces with Magneto. <br><br><b>Duration:</b> 1hr45min </font></html>");
final JLabel copyright=new JLabel("<html><font color=blue face=arial size=3><p align=center>© Copyright 2004</p></font></html>");
action_xmen.getContentPane().add(copyright,BorderLayout.SOUTH);
JButton view=new JButton("View");
view.setLayout(new BoxLayout(view,BoxLayout.X_AXIS));
view.add(Box.createHorizontalGlue());
view.add(Box.createRigidArea(new Dimension(30,0)));
view.setMinimumSize(new Dimension(20,100));
view.setPreferredSize(new Dimension(20,100));
view.setMaximumSize(new Dimension(Short.MAX_VALUE,Short.MAX_VALUE));
view.setMnemonic('v');
view.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
String a="172.22.45.44/42050";
String b="172.22.45.44/42052";
String argv=a+b;
Client cl= new Client(a,b);
String[] c={a,b};
cl.mainCl(c);
//this is the code i added so that on clicking the view button
//the client is automatically connected to the server and the player
//plays on the current machine
main.add(clickmovie_men);
main.add(view);
//action_xmen.getContentPane().add(view,BorderLayout.SOUTH);
action_xmen.getContentPane().add(main,BorderLayout.WEST);
action_xmen.getContentPane().add(xmen_overview,BorderLayout.EAST);
action_xmen.show();
else if(act=="Spiderman")
JFrame action_spider= new JFrame("--- New Line Movie: Spiderman --- ");
action_spider.setSize(400,350);
action_spider.show();
//Create combo box with cartoon movies choices
JComboBox cartoonChoices=null;
String[] cartoonmovie={"-Select a movie-","Le Roi Lion"};
cartoonChoices=new JComboBox(cartoonmovie);
cartoonChoices.setSelectedIndex(0);
cartoonPanel.add(cartoonChoices);
//cartoonChoices.addActionListener();
//Create combo box with comedy movies choices
JComboBox comedyChoices=null;
String[] comedymovie={"-Select a movie-"};
comedyChoices=new JComboBox(comedymovie);
comedyChoices.setSelectedIndex(0);
comedyPanel.add(comedyChoices);
//comedyChoices.addActionListener();
//Create combo box with fiction movies choices
JComboBox fictionChoices=null;
String[] fictionmovie={"-Select a movie-","ET"};
fictionChoices=new JComboBox(fictionmovie);
fictionChoices.setSelectedIndex(0);
fictionPanel.add(fictionChoices);
//fictionChoices.addActionListener();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
//Implement player function here
import java.io.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
import java.util.Vector;
import javax.media.*;
import javax.media.rtp.*;
import javax.media.rtp.event.*;
import javax.media.rtp.rtcp.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.media.format.AudioFormat;
import javax.media.format.VideoFormat;
import javax.media.Format;
import javax.media.format.FormatChangeEvent;
import javax.media.control.BufferControl;
* Client to receive RTP transmission using the RTPConnector.
public class Client implements ReceiveStreamListener, SessionListener,
ControllerListener
String sessions[] = null;
RTPManager mgrs[] = null;
Vector playerWindows = null;
boolean dataReceived = false;
Object dataSync = new Object();
public Client(String sessions[]) {
this.sessions = sessions;
public Client(String a, String b)
}//constructor
protected boolean initialize() {
try {
mgrs = new RTPManager[sessions.length];
playerWindows = new Vector();
SessionLabel session;
// Open the RTP sessions.
for (int i = 0; i < sessions.length; i++) {
// Parse the session addresses.
try {
session = new SessionLabel(sessions);
} catch (IllegalArgumentException e) {
System.err.println("Failed to parse the session address given: " + sessions[i]);
return false;
System.err.println(" - Open RTP session for: addr: " + session.addr + " port: " + session.port + " ttl: " + session.ttl);
mgrs[i] = (RTPManager) RTPManager.newInstance();
mgrs[i].addSessionListener(this);
mgrs[i].addReceiveStreamListener(this);
// Initialize the RTPManager with the RTPSocketAdapter
mgrs[i].initialize(new RTPSocketAdapter(
InetAddress.getByName(session.addr),
session.port, session.ttl));
// You can try out some other buffer size to see
// if you can get better smoothness.
BufferControl bc = (BufferControl)mgrs[i].getControl("javax.media.control.BufferControl");
if (bc != null)
bc.setBufferLength(350);
} catch (Exception e){
System.err.println("Cannot create the RTP Session: " + e.getMessage());
return false;
// Wait for data to arrive before moving on.
long then = System.currentTimeMillis();
long waitingPeriod = 30000; // wait for a maximum of 30 secs.
try{
synchronized (dataSync) {
while (!dataReceived &&
System.currentTimeMillis() - then < waitingPeriod) {
if (!dataReceived)
System.err.println(" - Waiting for RTP data to arrive...");
dataSync.wait(1000);
} catch (Exception e) {}
if (!dataReceived) {
System.err.println("No RTP data was received.");
close();
return false;
return true;
public boolean isDone() {
return playerWindows.size() == 0;
* Close the players and the session managers.
protected void close() {
for (int i = 0; i < playerWindows.size(); i++) {
try {
((PlayerWindow)playerWindows.elementAt(i)).close();
} catch (Exception e) {}
playerWindows.removeAllElements();
// close the RTP session.
for (int i = 0; i < mgrs.length; i++) {
if (mgrs[i] != null) {
mgrs[i].removeTargets( "Closing session from AVReceive3");
mgrs[i].dispose();
mgrs[i] = null;
PlayerWindow find(Player p) {
for (int i = 0; i < playerWindows.size(); i++) {
PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
if (pw.player == p)
return pw;
return null;
PlayerWindow find(ReceiveStream strm) {
for (int i = 0; i < playerWindows.size(); i++) {
PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
if (pw.stream == strm)
return pw;
return null;
* SessionListener.
public synchronized void update(SessionEvent evt) {
if (evt instanceof NewParticipantEvent) {
Participant p = ((NewParticipantEvent)evt).getParticipant();
System.err.println(" - A new participant had just joined: " + p.getCNAME());
* ReceiveStreamListener
public synchronized void update( ReceiveStreamEvent evt) {
RTPManager mgr = (RTPManager)evt.getSource();
Participant participant = evt.getParticipant(); // could be null.
ReceiveStream stream = evt.getReceiveStream(); // could be null.
if (evt instanceof RemotePayloadChangeEvent) {
System.err.println(" - Received an RTP PayloadChangeEvent.");
System.err.println("Sorry, cannot handle payload change.");
System.exit(0);
else if (evt instanceof NewReceiveStreamEvent) {
try {
stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
DataSource ds = stream.getDataSource();
// Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
if (ctl != null){
System.err.println(" - Recevied new RTP stream: " + ctl.getFormat());
} else
System.err.println(" - Recevied new RTP stream");
if (participant == null)
System.err.println(" The sender of this stream had yet to be identified.");
else {
System.err.println(" The stream comes from: " + participant.getCNAME());
// create a player by passing datasource to the Media Manager
Player p = javax.media.Manager.createPlayer(ds);
if (p == null)
return;
p.addControllerListener(this);
p.realize();
PlayerWindow pw = new PlayerWindow(p, stream);
playerWindows.addElement(pw);
// Notify intialize() that a new stream had arrived.
synchronized (dataSync) {
dataReceived = true;
dataSync.notifyAll();
} catch (Exception e) {
System.err.println("NewReceiveStreamEvent exception " + e.getMessage());
return;
else if (evt instanceof StreamMappedEvent) {
if (stream != null && stream.getDataSource() != null) {
DataSource ds = stream.getDataSource();
// Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
System.err.println(" - The previously unidentified stream ");
if (ctl != null)
System.err.println(" " + ctl.getFormat());
System.err.println(" had now been identified as sent by: " + participant.getCNAME());
else if (evt instanceof ByeEvent) {
System.err.println(" - Got \"bye\" from: " + participant.getCNAME());
PlayerWindow pw = find(stream);
if (pw != null) {
pw.close();
playerWindows.removeElement(pw);
* ControllerListener for the Players.
public synchronized void controllerUpdate(ControllerEvent ce) {
Player p = (Player)ce.getSourceController();
if (p == null)
return;
// Get this when the internal players are realized.
if (ce instanceof RealizeCompleteEvent) {
PlayerWindow pw = find(p);
if (pw == null) {
// Some strange happened.
System.err.println("Internal error!");
System.exit(-1);
pw.initialize();
pw.setVisible(true);
p.start();
if (ce instanceof ControllerErrorEvent) {
p.removeControllerListener(this);
PlayerWindow pw = find(p);
if (pw != null) {
pw.close();
playerWindows.removeElement(pw);
//p.close(); //i added to know if player close when click
System.err.println("Client internal error: " + ce);
* A utility class to parse the session addresses.
class SessionLabel {
public String addr = null;
public int port;
public int ttl = 1;
SessionLabel(String session) throws IllegalArgumentException {
int off;
String portStr = null, ttlStr = null;
if (session != null && session.length() > 0) {
while (session.length() > 1 && session.charAt(0) == '/')
session = session.substring(1);
// Now see if there's a addr specified.
off = session.indexOf('/');
if (off == -1) {
if (!session.equals(""))
addr = session;
} else {
addr = session.substring(0, off);
session = session.substring(off + 1);
// Now see if there's a port specified
off = session.indexOf('/');
if (off == -1) {
if (!session.equals(""))
portStr = session;
} else {
portStr = session.substring(0, off);
session = session.substring(off + 1);
// Now see if there's a ttl specified
off = session.indexOf('/');
if (off == -1) {
if (!session.equals(""))
ttlStr = session;
} else {
ttlStr = session.substring(0, off);
if (addr == null)
throw new IllegalArgumentException();
if (portStr != null) {
try {
Integer integer = Integer.valueOf(portStr);
if (integer != null)
port = integer.intValue();
} catch (Throwable t) {
throw new IllegalArgumentException();
} else
throw new IllegalArgumentException();
if (ttlStr != null) {
try {
Integer integer = Integer.valueOf(ttlStr);
if (integer != null)
ttl = integer.intValue();
} catch (Throwable t) {
throw new IllegalArgumentException();
* GUI classes for the Player.
class PlayerWindow extends Frame {
Player player;
ReceiveStream stream;
PlayerWindow(Player p, ReceiveStream strm) {
player = p;
stream = strm;
public void initialize() {
add(new PlayerPanel(player));
public void close() {
player.close();
setVisible(false);
dispose();
public void addNotify() {
super.addNotify();
pack();
* GUI classes for the Player.
class PlayerPanel extends Panel {
Component vc, cc;
PlayerPanel(Player p) {
setLayout(new BorderLayout());
if ((vc = p.getVisualComponent()) != null)
add("Center", vc);
if ((cc = p.getControlPanelComponent()) != null)
add("South", cc);
public Dimension getPreferredSize() {
int w = 0, h = 0;
if (vc != null) {
Dimension size = vc.getPreferredSize();
w = size.width;
h = size.height;
if (cc != null) {
Dimension size = cc.getPreferredSize();
if (w == 0)
w = size.width;
h += size.height;
if (w < 160)
w = 160;
return new Dimension(w, h);
public static void mainCl(String argv[])
if (argv.length == 0)
prUsage();
Client avReceive = new Client(argv);
if (!avReceive.initialize()) {
System.err.println("Failed to initialize the sessions.");
System.exit(-1);
// Check to see if Client is done.
try {
while (!avReceive.isDone())
Thread.sleep(1000);
} catch (Exception e) {}
System.err.println("Exiting Client");
static void prUsage() {
System.err.println("Usage: Client <session> <session> ...");
System.err.println(" <session>: <address>/<port>/<ttl>");
System.exit(0);
}// end of Clienthi,
i have try compile your source code...anyway, there is 28 errors..I m not sure where is the errors come from. Currently , i m working on the same project as you. Trying to play the media at client machine, but stil can't manage to do so. Can i have your email address? I want to consult you a bit about my project .Is it ok? Thanks =). -
Creating a link to text file in a tomcat server not working in JSP webapp
I am using netbeans to create an web application within my desktop, and then I load the build/web folder to a tomcat server to test the application. Everything works fine. However, when I try to link up my JSP pages to text files (.txt) create by the application on the server, I seem to be getting files that might be kept in a terminal.
When I get the Real path of the servlet context, I find that it is to a C:\ type file rather than a //hostname type of directory. So obviously those files are not being reached.
Does anybody know how to deal this problem?There are a number of ways to get to the Flash Global Security settings dialog.
My favourite way is just to double click on a Captivate SWF (not the HTM file) to open it in a web browser, then right click on the playing screen to get the Flash context menu. On the context menu, click the Global Settings option.
In the web page that opens, click the link on the left to Global Security Settings.
Add the folder or drive location of your published Captivate content to the Trusted Locations. -
I want to write in a XML file which is located on the TOMCAT server
hello all,
can anybody tell me or give me code snippet for writing some data through my application i.e from client side on te file which is located on the TOMCAT server(especially XML file).
tell me how can i do that?
it is urgent
cya
sushHello sush,,,,
I am sending you some API / classes that will definetely help you for writing XML file through java.
1) TransformerFactory.newInstance();
2)Transformer serializer
3)StreamResult
4)serializer.transform(source,result);
5)DOMSource
From Vikas_khengare
[ [email protected] ] -
Write Access to a file in Tomcat server via J2me Midlet
How to make write access to a file using midlet and HTTP connection?
I have text file in the Tomcat server and I am able to read it with HTTP connection using emulator, but don't have idea how to make write access to the file. I'd like to write some text to the file.Thanks, but could you be more accurate. What methods should I use in the servlet and what methods in the midlet?
Some links which concern this subject, would be nice too. I have tried with google, no success. -
Problem with Java Studio Creator and Tomcat Server
Hi Gays ,
I have problem:
here is the error from tomcat 5
com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: statement handle not executed: getMetaData
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java: 601)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.ja va:316)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87 )
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
if i develop application on my pc ( java studio creator with sun apps bundlled) is working perfectly,
but i migrated application to Tomcat Server ( Database the same - Oracle 10 g)
i can't show value ( as text) from datasoruce ( is in SessionBean1)
(Category-.>Subcat->Items->details( url from items table[items.jsp])
this is a working url "/faces/testpage.jsp?auk_id=31 "
( working with sun apps server , but not on Tomcat 5)
below prerender method in details.java and fragment of details.jsp
public void prerender() {
try {
String idauk = (getExternalContext().getRequestParameterMap().get("auk_id").toString());
System.out.println("wartosc auk_id " + idauk);
if (idauk != null) {
getSessionBean1().getDetailsRowSet().setObject(1,idauk);
getSessionBean1().getDetailsDataProvider().refresh();
details.jsp
xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<ui:page binding="#{testpage.page1}" id="page1">
<ui:html binding="#{testpage.html1}" id="html1">
<ui:head binding="#{testpage.head1}" id="head1">
<ui:link binding="#{testpage.link1}" id="link1" url="/resources/stylesheet.css"/>
</ui:head>
<ui:body binding="#{testpage.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{testpage.form1}" id="form1">
<ui:staticText binding="#{testpage.staticText1}" id="staticText1" style="position: absolute; left: 120px; top: 96px" text="#{SessionBean1.testDataProvider.value['Name']}"/>
</ui:form>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>
Help People ! Any Ideas I'm stuck, why is working with Sun Servet but not with Tomcat and only just thing ?
Thanks in advance for helping me to resolve the night problem :)Hi I found solution, i puted on the page a table -component (with brand new automaticly created dataprovider) , then i set properties visible= false for table, and now I can bind statictext with database field and deploy on tomcat server .
But i think it is not a elegant solution in page source i habe noused-code.
Have Any another Ideas. HELP PEOPLE !!!!
Mariuszek: I use Creator.because right now I can see result of my job and i can qickly change ideas ,
I tried with JDeveleper but i did'nt find this functionality (wich version do you prefered ?) , unfortunately i have to deploy my application on Tomcat. This is my study project, and i make this to become a Master of Techinal Univeristy ;), Deadline time is 30 th September :(
greetings -
Problem to deploy ADF application on tomcat server
Hi all,
i 'm using this tutorial link to deploy adf application on tomcat server.
https://blogs.oracle.com/dana/entry/how_to_deploy_a_11g_adf_applic_1
but when i have run my application i have got following error
java.sql.SQLException: invalid arguments in call
log-
Jul 29, 2013 11:35:16 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b07-FCS) for context '/TestApacheApp_ViewController_webapp1'
Jul 29, 2013 11:35:19 AM oracle.adf.mbean.share.connection.ADFConnectionLifeCycleCallBack contextInitialized
SEVERE: ADFConnection mbean not registered for defaultApplicationName.
Jul 29, 2013 11:35:19 AM oracle.adf.mbean.share.connection.ADFConnectionLifeCycleCallBack contextInitialized
SEVERE:
oracle.jrf.UnknownPlatformException: JRF is unable to determine the current application server platform.
at oracle.jrf.ServerPlatformSupportFactory.getInstance(ServerPlatformSupportFactory.java:79)
at oracle.adf.mbean.share.connection.ADFConnectionLifeCycleCallBack.contextInitialized(ADFConnectionLifeCycleCallBack.java:82)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:515)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1471)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:243)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Thread.java:662)
Jul 29, 2013 11:35:19 AM oracle.adf.mbean.share.config.ADFConfigLifeCycleCallBack contextInitialized
SEVERE: Failed to register config mbean for defaultApplicationName.
Jul 29, 2013 11:35:19 AM oracle.adf.mbean.share.config.ADFConfigLifeCycleCallBack contextInitialized
SEVERE:
oracle.jrf.UnknownPlatformException: JRF is unable to determine the current application server platform.
at oracle.jrf.ServerPlatformSupportFactory.getInstance(ServerPlatformSupportFactory.java:79)
at oracle.adf.mbean.share.config.ADFConfigLifeCycleCallBack.contextInitialized(ADFConfigLifeCycleCallBack.java:79)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:515)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1471)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:243)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Thread.java:662)
Jul 29, 2013 11:35:19 AM oracle.bc4j.mbean.BC4JConfigLifeCycleCallBack contextInitialized
SEVERE: Not able to get Deployment Name
Jul 29, 2013 11:35:28 AM oracle.adfinternal.controller.state.ControllerState initializeRequest
WARNING: ADFc: Deserialization of session state detected but ADF scope HA support is not enabled. Please enable ADF scope HA support in the adf-config.xml file to ensure correct functioning of your applicaiton.
Jul 29, 2013 11:35:28 AM oracle.adf.share.http.ServletADFContext initialize
WARNING: Found wrong applictionScope sticking to oldContext for oldApplication defaultApplicationName, while the current one is null
Jul 29, 2013 11:35:28 AM oracle.jbo.uicli.mom.CpxUtils$Visitor logMainApplicationCpx
INFO: jndi:/localhost/TestApacheApp_ViewController_webapp1/WEB-INF/classes/com/in/jagran/view/DataBindings.cpx
Jul 29, 2013 11:35:28 AM oracle.adf.share.jndi.MDSBackingStore documentExists
INFO: MDS-00013: no metadata found for metadata object "/META-INF/connections.xml"
Jul 29, 2013 11:35:32 AM oracle.adf.share.http.ServletADFContext initialize
WARNING: Found wrong applictionScope sticking to oldContext for oldApplication defaultApplicationName, while the current one is null
Jul 29, 2013 11:35:33 AM oracle.adf.share.http.ServletADFContext initialize
WARNING: Found wrong applictionScope sticking to oldContext for oldApplication defaultApplicationName, while the current one is null
Jul 29, 2013 11:35:47 AM org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8086
Jul 29, 2013 11:35:47 AM org.apache.coyote.ajp.AjpAprProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-8009
Jul 29, 2013 11:35:48 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 29, 2013 11:35:48 AM org.apache.coyote.http11.Http11AprProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8086
Jul 29, 2013 11:35:48 AM org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009There is no guideline I know of as this depends on the app itself.
What you should do is to deploy the application onto a test server and check the metrics of the app over a defined period of time with a defined amount of traffic.
Timo -
How can i avoid restarting tomcat server when servlet is modified?
please advice me that how can i avoid restarting the tomcat server, whenever a servlet file is modified in my application. is their any way ?
No probs. Here's how I do things...
1. Install tomcat as normal (e.g. I install to C:\Apps\jakarta-tomcat-5.5.4)
2. Create a webapps directory in your eclipse project with the following directory structure
MyEclipseProject
- src
- conf
- webapps
- MyApplication
- META-INF
- WEB-INF
- classes
- lib
- pages3. Set the project's output folder (e.g. bin folder) to webapps/MyApplication/WEB-INF/classes
4. Put all your jar files in the lib directory
5. Put JSPs / HTML in the pages directory (you may also want to create additional directories for TLDs, config files etc)
6. Ensure your web.xml is in the WEB-INF directory
7. Although it isn't essential I create a context.xml file and store it in META-INF, e.g.
<Context reloadable="true">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/conf/struts/struts-config.xml</WatchedResource>
<WatchedResource>WEB-INF/conf/struts/tiles-defs.xml</WatchedResource>
<WatchedResource>WEB-INF/conf/struts/validation.xml</WatchedResource>
</Context>I use this to set monitored resources that will trigger an automatic appliation reload and to configure JAAS (not shown). See the Tomcat documentation for additional information.
8. In the 'conf' directory I create a server.xml file used to configure Tomcat (you can copy the one from your <TOMCAT_HOME>/conf/server.xml).
After copying the file change appBase attribute in the host element to be the full path to the webapps directory. You can also change the HTTP and HTTPS ports if you wish
9. Download and install the Tomcat Launcher plugin from Sysdeo.
10. In Eclipse's Preferences menu you will see a new entry for Tomcat. Click this then
a. Set your Tomcat Version
b. Set your Tomcat Home
c. Set "Context declaration mode" to server.xml
d. Set the configuration file to the full path to your server.xml file created in step 8
On the "Advanced " sub page select all relevant projects to add to the Tomcat classpath
On the "JVM Settings" page add all the jars in your WEB-INF lib directory to the class path
On the "Source Path" page select all relevant projects
Now if you start Tomcat using the Tomcat icon, you will be able to remote debug your application. If you change web.xml (or any other file in your context.xml watched resources) it will automatically reload. Any changes to JSPs will automatically be picked up (providing your tell your browser not to use the page in cache - e.g. CTRL+F5 in IE)
There are some limitations that I'm still working on however. Primarily that I haven't included the Tomcat Manager application in my webapps directory, so Sysdeo cannot perform a reload. This means that if I change a source file, and eclipse auotmatically rebuilds, Tomcat doesn't pick up the change unless I either change a watched resource file (e.g. web.xml) or stop and restart Tomcat.
There's no reason why this can't be fixed, I just haven't got round to it yet.
I'm sure there are lots of other (probably better) ways of achieving the same thing. This was the first method I tried and it worked, so I stuck with it. I'm not a Tomcat config guru and I'm sure other forum users could provide some improvements should they wish.
Post if you get into trouble, however I won't be able to respond until next week.
Cheers,
Steve -
Tomcat : Hlow to run more than 1 instance of tomcat server on same machine?
Hi,
How to run more than 1 instance of tomcat server on the same machine.
I use tomcat 5.5. ,updated port number for second instance and tried to run,it takes the same old port number .No batch file available with this version to update the home directory to second instance to run the second server..
How to work on clustering and load balancing on tomcat server?
Any inputs?
Thanks in advance..
AniAnitha123 wrote:
We have only 1 dedicated server maintained by third party for hosting..
If are only getting your site hosted, then, normally, the host would handle clustering (to your sepcifications, of course, but it is normally the hosts responsibility).
If i need to implement clustering and load balancing for tomcat server then do we need to go for 2 different servers for production environment?
Yes, you would need two, or more, servers.
Also please guide me on how to implement clustering and load balancing for tomcat server by running 2 instances on 2 different machine? I'm a newbie to it..
It should have no (or at least minimal) impact on the code (as long as you are using beans, sessions, and the other components properly). It is handled by the web container (by the tomcat in this case). The tomcat documentation should show how to set it up (if it supports it all, I don't know, we don't have Tomcat at work, and at home I use only a single).
Maybe you are looking for
-
Hi, I have a plug-in that I've compiled in 32-bit and 64-bit versions, and the 32-bit version loads fine in Photoshop 32-bit, but the x64 version fails to load in Photoshop 64-bit. I saw Jim Watters' thread about this, and added this to my .r file:
-
I have 2 account on my macbook. One account seem to be cannot save any preferences, such as safari browsing history, my keynote custom toolbar, recent documents, etc. Everything seem to be reset after restart, the other account works just fine. Any i
-
LSMW RFBIBL00 withholding tax base amount in local currency cannot be updated by manual
Hi SAP Guru, When I try to upload FI docs by program RFBIBL00 in LSMW, the field BWITH-WT_QSSHH(withholding tax base amount in local currency) cannot be updated. (1) The LSMW structure is defined as bellow: BGR00<--------DOC_HEAD BBKPF
-
Ipod sound only works for right ear
Hello. I have an Apple Ipod 5th generation. I have had it for a few months now. Lately, the right channel sound stopped working. Only the left ear works. It does not matter which headphones I use. If i pull the headphone jack out a little bit, I get
-
we have an one zreport for AUC report where we would like to introduce Internal Order Group on the report selection screen. We are unable to trace this field to a table. please help me for the same Regards RRR