 |
 |
Index ‹ java-programmer
|
- Previous
- 2
- why call cipher.getInstance(),throw below error?my source code is:
Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("RSA/NONE/PKCS1PADDING","BC");
when run it , cause below error,who can explain it,thanks in
advance.....
java.lang.ExceptionInInitializerError
at java.lang.Class.runStaticInitializers(Unknown Source)
at javax.crypto.Cipher.a(Unknown Source)
at javax.crypto.Cipher.getInstance(Unknown Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.rsaDecrypt(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.fetchSignature(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.checkCredentialValues(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.checkCredentials(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.DVBSecUtils.invokeSecurity(Unknown
Source)
at org.dvb.lang.DVBClassLoader.securityCheck(Unknown Source)
at org.dvb.lang.DVBClassLoader.acquireData(Unknown Source)
at org.dvb.lang.DVBClassLoader.defineClassPrivileged(Unknown
Source)
at org.dvb.lang.DVBClassLoader.access$000(Unknown Source)
at org.dvb.lang.DVBClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at org.dvb.lang.DVBClassLoader.findClass(Unknown Source)
at org.dvb.lang.DVBClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.tv.Request.execReq(Unknown Source)
at com.sun.tv.XletRunnable$ExecThread.run(Unknown Source)
at java.lang.Thread.startup(Unknown Source)
Caused by: java.lang.SecurityException: Cannot set up certs for
trusted CAs
at javax.crypto.SunJCE_b.<clinit>(Unknown Source)
... 20 more
Caused by: java.lang.SecurityException: Jurisdiction policy files
are not signed by trusted signers!
at javax.crypto.SunJCE_b.f(Unknown Source)
at javax.crypto.SunJCE_b.e(Unknown Source)
at javax.crypto.SunJCE_s.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
... 21 more
- 7
- JPanel doenst growHey, I am beginning Java Student with a Java Problem. I looked on the
Internet but didn't find my answer anywhere, maybe you guys could help ?
I have a:
JFRAME --> Container+GridBayLayout
Container+GridBayLayout --> JPanel options
--> JScrollpanel
JScrollpanel --> add(new RectangleGroup());
//A piece of the entire class RectangleGroup:
-------------------
public class RectangleGroup extends JPanel
{
public void paintComponent(Graphics g)
{
this.g = g;
super.paintComponent(g);
//A lot of THESE Things
g.drawRect(150,100,100,10);
}
}
-------------------
The problem is that I dont get a scrollbar when I draw a rectangle that is
out of sight in the browser.
A have uploaded a picture of it here:
http://www.denbreejen.net/public/School/dnaproject2/browser_problem.gif
Wouter
--
Message posted via http://www.javakb.com
- 8
- Applet caching in IE5 - permanently!
I have the same problem and I posted the question a couple of weeks ago
but no one seemed to care or know what happened.
> -----Original Message-----
> From: email***@***.com (Dave) [SMTP:email***@***.com]
> Posted At: Wednesday, July 16, 2003 5:43 AM
> Posted To: comp.lang.java.programmer
> Conversation: Applet caching in IE5 - permanently!
> Subject: Applet caching in IE5 - permanently!
>
> IE seems to be caching applet classes forever. The 'CTRL-REFRESH'
> thing used to work (I've been doing that for years). But just recently
> (about 1 month ago), this stopped working. Deleting temporary files,
> restarting IE and even rebooting doesn't seem to flush the cache. I'm
> really confused - where could it be caching it?
>
> The only thing I can think of is that a 'Windows update' has installed
> an IE patch that has broken something.
>
> Has anyone else experienced this? Am I going mad?
- 8
- CFP - IT Underground 2006, Prague, Czech RepublicHello,
I'd like to announce the call for papers for the IT Underground 2006, a
two-day conference organized by Software Conferences and hakin9.lab team in
23-24 February 2006, Prague, Czech Republic.
IT Underground 2006 is a fifth edition of a conference dedicated to IT
security issues, where remarkable authorities will share their knowledge and
experience with IT specialists.
In previous editions we had pleasure to listen to: Ofir Arkin, Maximillian
Dornseif, David h1kari Hulton, Chuck Willis, Charl Van der Walt, Shalom
Carmel, Martin Herfurt, Adam Laurie, Marcel Holtmann, Alexander Kornbrust,
Saumil Udayan Shah, Robert Lee Ayers, Dave Aitel, Stefano Zanero, Thorsten
Holz, Joanna Rutkowska, Michael Shema, Piotr Sobolewski, Michal Szymanski,
Paul Wouters, Rakan El-Khalil, Wojciech Dworakowski, K.K. Mookhey, Pawel
Krawczyk.
The dead line for lecture proposals is the 15th of January, 2006.
All the detailed information you can find on http://www.itUnderground.org/
We hope that you find our offer interesting. Please, contact me to discuss
further details of our cooperation.
IT Underground 2006 - basic characteristics.
When: 23-24 February 2006
Where: Prague, Czech Republic
Topic: IT Security
We assure:
- hotel accommodation and transfer,
- full support for your presentation, both before and during the conference,
- providing the necessary technical facilities for the presentation,
- assistance in acquiring and publishing presentation materials, information
about your lecture in the conference brochure,
- supervising and directing the overall progress of the conference.
--
Piotr Sobolewski
email***@***.com
- 9
- How often to get a reference to my cached bean?Hi I have an entity bean which caches data. It could sit in the
container for a very long time.
This entity bean has references to other similary beans that cache.
Should I get a single reference to the other beans once - on startup or
should I lookup the bean every time I need it?
MyClassHome refhome = MyHomeHelper.getHome();
MyCacheClass reference = refhome.find();
The only reason I can think of for looking it up may be if the resource
(bean) moved to another server due to a crash/failover etc?
thanks
Tim
- 9
- Tomcat classpath and servlets outside of WEB-INFHi,
Does anybody know if it is possible to execute servlets outside the
WEB-INF directory? Somebody at work thinks that setting the classpath
would help. But I have had no luck so far. I'm currently on a
Win2000 box running Apache, Tomcat 4.1.18, j2sdk 1.4.2. And I found
out (to my dismay) that symbolic linking doesn't work with Windows. I
don't even know if symbolic linking would work if it was a linux box.
People at work say that Tomcat has worked and it was executing
servlets outside the WEB-INF directory. They are very sure on this
point. But it broke, and they decided to deleted the entire
installation (conf file and all). And the person who got it to work
is no longer here. So I'm at square one. Jserv had been running the
servlets, but the company wants to move forward. The servlets had
been mapped to Jserv through the classpath.
Any help or ideas would be greatly appreciated.
Jim
- 9
- 14
- Jruby and script loadingI am looking for different ways to load jruby scripts from java. Has
anyone been doing this. JRuby 1.0 and Java 1.6
Berlin Brown
- 14
- Writing and running files from a Java/AspectJ application.I'm creating an add-on to windows that will let me create files and run
basic functions such a image editing, both built in and on the hard
drive of a ftp server. If anyone could help me it would be wonderful.
I am planning to use the Eclispe SDK woth the AspectJ plugin. I have
the basic functions set up word editing but I need to know how to run
.exe files on the hard drive.
- 15
- 15
- Stateless Session Beans and a Stateful Singleton? (Sharing dataI am interested in solving the same problem.
I currently have a solution involving JMX and WebLogic cluster.
1-create dynamic Mbean with synchronized methods
2-register with WL admin server as MBean agent/manager
3-all managed servers/users in cluster have access to this singleton
4-as clients log in/out they can invoke addUser/deleteUser methods on
dynamic mbean. They can also read currentUserCount.
PROBLEM:Single point of failure on admin server.
Looking for a simpler solution as you described above, OR
figuring out how to have dynamic MBean replicated in cluster so that each
managed server uses a local replicated copy--not sure how to achieve this
yet...
- 15
- Change look of disabled JButtonHello
How can I change the look of a disabled JButton? I have made a boardgame
with a brown background and brown buttons. I have also put an imageicon on
the buttons that has a colored image on it. When I disable the buttons, the
colored image is turned into grey which screws up the look of my game.
Can I change the grey color on a disabled button? Or do I have to keep it
enabled, and attach another imageicon with different color to show the user
he can't click the button?
Also, I can sometimes see a blue/gray line around my buttons. I want to get
rid of it, so I guess it has something to do with setBorder, but I can't
find it.
Thx,
Oswald
- 16
- Problem with JDBC-ODBC connection to MS Access 2000I am trying to use JDBC-ODBC bridge to connect to a Access 2000
database on a Windows 2000 machine. I have set up
the database using the Data Sources utility in Windows 2000. I am
using the Java(TM) 2 SDK, Standard Edition
Version 1.4.2_01. The code snippet from an example I found is:
import java.sql.*;
import javax.swing.JOptionPane;
public class BookDB{
private static Connection connection;
private static Statement scrollStatement;
private static ResultSet books;
public static void connect() throws ClassNotFoundException,
SQLException {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:MurachBooks";
String user = "Admin";
String password = "";
connection = DriverManager.getConnection(url, user, password);
}
When I complie I get the following error:
BookDB.java [10:1] cannot resolve symbol
symbol : method forName (java.lang.String)
location: class Class
try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
^
1 error
Errors compiling BookDB.
I have looked at all of the possible sources of information I can
think of to find an answer to my problem.
- 16
- Cannot Find My API classThere goes the error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 0 in the jsp file: /time.jsp
Generated servlet error:
[javac] Compiling 1 source file
F:\JAVA\TomCat41\work\Standalone\localhost\bigj\time_jsp.java:41:
cannot resolve symbol
symbol : class TimeFormatterBean
location: class org.apache.jsp.time_jsp
TimeFormatterBean formatter = null;
^
How can be seen, it cannot locate the TimeFormatterBean class. I've
placed my application in the dir:
%CATALINA_HOME%\webapps\bigj\
and the class in here:
%CATALINA_HOME%\webapps\bigj\WEB-INF\classes
so.. y dam it ain't working?
- 16
- Client/Server chat program - wait for connectionHi,
I'm trying to modify a client/server chat program that connects
immediately, to wait till an IP address is selected from a combo box and
then connect when a connect button is pressed. The combo box is loaded
from a file of IP addresses and I select the localhost address of
127.0.0.1.
I've taken out the app.runClient line from the main class and made it
the actionPerformed when the connect button is pressed, but the client
side seems to go dead (won't accept any input) when I do this although
the connection seems to be working.
Any help appreciated.
// Client.java
// Set up a Client that will read information sent
// from a Server and display the information.
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Client3 extends JFrame
{ private JTextField enter;
private JTextArea display;
private JButton connect, send;
private JComboBox selectIp;
ObjectOutputStream output;
ObjectInputStream input;
String message = "", address = "";
public Client3()
{
super( "Client" );
Container c = getContentPane();
JPanel northPanel = new JPanel();
northPanel.setLayout( new GridLayout( 2, 1, 3, 3 ) );
// Enter field and action listener
enter = new JTextField();
enter.setEnabled( false );
enter.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
{
sendData( e.getActionCommand() );
}
}
);
northPanel.add( enter );
// Send button
send = new JButton("Send >");
send.addActionListener(
new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
sendBtn( e.getActionCommand() );
}
}
);
northPanel.add( send );
c.add( northPanel, BorderLayout.NORTH );
// Dislay area
display = new JTextArea();
c.add( new JScrollPane( display ),
BorderLayout.CENTER );
JPanel southPanel = new JPanel();
southPanel.setLayout( new GridLayout( 1, 2, 3, 3 ) );
// SelectIP combobox, listener and item listener
selectIp = new JComboBox();
selectIp.addItemListener(
new ItemListener() {
public void itemStateChanged( ItemEvent evt )
{
if( evt.getSource() == selectIp )
if( evt.getStateChange() == ItemEvent.SELECTED )
address = (String) evt.getItem();
}
} );
southPanel.add( selectIp );
// Read file and load into combobox
try
{
BufferedReader inBuffer = new BufferedReader( new
FileReader("ipaddress.txt") );
String line = inBuffer.readLine();
while( line != null )
{
selectIp.addItem( line );
line = inBuffer.readLine();
}
inBuffer.close();
}
catch(IOException e)
{ System.out.println(e);
}
// Connect button
connect = new JButton( "Connect");
connect.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
{
if( e.getSource() == connect )
{
runClient();
}
}
} );
southPanel.add( connect );
c.add( southPanel, BorderLayout.SOUTH );
setSize( 300, 300 );
show();
} // end Client constructor
public void runClient()
{ Socket client;
try {
// Step 1: Create a Socket to make connection.
display.setText( "Attempting connection\n" );
client = new Socket(
InetAddress.getByName( address ), 6000 );
display.setText( "Connected to: "+ address +
client.getInetAddress().getHostName() );
// Step 2: Get the input and output streams.
output = new ObjectOutputStream(
client.getOutputStream() );
output.flush();
input = new ObjectInputStream(
client.getInputStream() );
display.append( "\nGot I/O streams" );
// Step 3: Process connection.
enter.setEnabled( true );
do
{ try {
message = (String) input.readObject();
display.append( "\n" + message );
display.setCaretPosition(
display.getText().length() );
}
catch ( ClassNotFoundException cnfex ) {
display.append(
"\nUnknown object type received" );
}
} while ( !message.equals( "SERVER>>> quit" ));
// Step 4: Close connection.
display.append( "\nClosing connection.\n" );
output.close();
input.close();
client.close();
} // end try
catch ( EOFException eof ) {
System.out.println( "Server terminated connection" );
}
catch ( IOException e ) {
e.printStackTrace();
}
} // end runClient
// Action handler for Enter key
private void sendData( String s )
{
try {
message = s;
output.writeObject( "CLIENT>>> " + s );
output.flush();
display.append( "\nCLIENT>>>" + s );
}
catch ( IOException cnfex ) {
display.append(
"\nError writing object" );
}
} // end sendData
// Action handler for send button
private void sendBtn( String s )
{
try {
s = enter.getText();
output.writeObject( "SERVER>>> " + s );
output.flush();
display.append( "\nSERVER>>>" + s );
}
catch ( IOException cnfex ) {
display.append(
"\nError writing object" );
}
} // end sendBtn
// Main
public static void main( String args[] )
{
Client3 app = new Client3();
app.addWindowListener(
new WindowAdapter()
{
public void windowClosing( WindowEvent e )
{ System.exit( 0 );
}
}
);
// app.runClient();
} // end main
} // end Client Class
// Server.java
// Set up a Server that will receive a connection
// from a client, send a string to the client,
// and close the connection.
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Server1 extends JFrame
{
private JTextField enter;
private JTextArea display;
ObjectOutputStream output;
ObjectInputStream input;
public Server1()
{
super( "Server" );
Container c = getContentPane();
enter = new JTextField();
enter.setEnabled( false );
enter.addActionListener(
new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
sendData( e.getActionCommand() );
}
}
);
c.add( enter, BorderLayout.NORTH );
display = new JTextArea();
c.add( new JScrollPane( display ),
BorderLayout.CENTER );
setSize( 300, 300 );
show();
} // end Server constructor
public void runServer()
{
ServerSocket server;
Socket connection;
int counter = 1, optionPane;
try {
// Create a ServerSocket.
server = new ServerSocket( 6000, 100 );
while ( true )
{
// Wait for a connection.
display.setText( "Waiting for connection\n" );
connection = server.accept();
display.append( "Connection " + counter +
" received from: " +
connection.getInetAddress().getHostName() );
// Set input and output streams.
output = new ObjectOutputStream(
connection.getOutputStream() );
output.flush();
input = new ObjectInputStream(
connection.getInputStream() );
display.append( "\nGot I/O streams\n" );
// Process connection.
String message =
"SERVER>>> Connection successful\n";
output.writeObject( message );
output.flush();
enter.setEnabled( true );
do {
try {
message = (String) input.readObject();
display.append( "\n" + message );
display.setCaretPosition(
display.getText().length() );
}
catch ( ClassNotFoundException cnfex ) {
display.append(
"\nUnknown object type received" );
}
if( message.equals( "CLIENT>>> TRANSFER FILE?" ) )
{
optionPane = JOptionPane.showConfirmDialog((Component)
null, "Do you want to accept the file transfer",
"File Transfer", JOptionPane.YES_NO_OPTION );
if( optionPane == JOptionPane.YES_NO_OPTION )
{
output.writeObject( "PRESS 'SEND FILE' BUTTON" );
output.flush();
display.append( "\nWAITING FOR FILE" );
}
else
{
output.writeObject( "NO - Do not send file" );
output.flush();
display.append( "\nNO - Do not send file" );
}
}
} while ( !message.equals( "CLIENT>>> quit" ) );
// Close connection.
display.append( "\nUser terminated connection" );
enter.setEnabled( false );
output.close();
input.close();
connection.close();
++counter;
} // end while
} // end try
catch ( EOFException eof ) {
System.out.println( "Client terminated connection" );
}
catch ( IOException io ) {
io.printStackTrace();
}
} // end runServer
private void sendData( String s )
{
try {
output.writeObject( "SERVER>>> " + s );
output.flush();
display.append( "\nSERVER>>>" + s );
}
catch ( IOException cnfex ) {
display.append(
"\nError writing object" );
}
} // end sendData
public static void main( String args[] )
{
Server1 app = new Server1();
app.addWindowListener(
new WindowAdapter()
{
public void windowClosing( WindowEvent e )
{ System.exit( 0 );
}
}
);
app.runServer();
} // end main
} // end Server Class
|
| Author |
Message |
Philipp Roethl

|
Posted: 2003-9-17 2:33:00 |
Top |
java-programmer, struts: Multipage form
Hi,
I'm collection data across several pages using one Form per page. The scope of
each form is set to session. Let's say I have form1, form2 and form3 and the
corresponding action classes. In the jsp corresponding to form3 I can access
form1 using form1 as bean name.
But how can I access form1 from the Action class corresponding to form3?
Hope that was not to confusing.
Thanks in advance,
phi
|
| |
|
| |
 |
Scott Yanoff

|
Posted: 2003-9-19 2:48:00 |
Top |
java-programmer >> struts: Multipage form
Philipp Roethl wrote:
> I'm collection data across several pages using one Form per page. The scope of
> each form is set to session. Let's say I have form1, form2 and form3 and the
> corresponding action classes. In the jsp corresponding to form3 I can access
> form1 using form1 as bean name.
> But how can I access form1 from the Action class corresponding to form3?
Can you pass in multiple forms to the "perform" method in your Action class:
public ActionForward perform(ActionMapping mapping,
ActionForm form, ActionForm form1,
etc...)
Otherwise, you could have one larger form bean instead of the three and
just reference it on each page.
Good luck,
--
-Scott
email***@***.com | http://www.yanoff.org | AOL IM: SAY KJY
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Code generation aplicationOn Mon, 11 Aug 2003 21:55:14 +0100, Alexandre Cotta Godinho wrote:
> Hello there !
>
> I need some help in increasing productivity. Do anyone knows about a
> code generation tool, as customizable as possible allowing to generate
> from UML dynamic diagrams as well. There is a nicely referenced product
> of name Codagen Architect (www.codagen.com), but it runs on Windows only.
>
> Thank you in advance
>
> Alexandre Cotta Godinho
TogetherJ or Rational Rose.
Both are -1 imo.
-c
- 2
- rapid development web interface to a databaseI am looking for the easiest web interface to a database. By easiest,
I mean most rapid development. Because the requirements are so simple
and standard, I'm hoping that something can take care of the grunt
work. Easy maintenance, possibly by non-programmers (or at least
"junior" programmers) would also be nice.
I'm open to Perl, PHP, Java in that order (best solution wins, equal
solutions go with the preferred language). I'm also open to anything
that doesn't require code to be written to get the job done, as long
as there's some way to extend it if I get stuck.
The design is simple and is an age-old story:
I have a database with about 15 tables. 5 contain data with the same
primary key, 2 have their own primary key but still a 1-to-1 mapping
to the "main" primary key, and 8 are master lists that the other
tables reference (site id, customer id, that sort of thing). I need
the following screens:
simple search based on a couple fields
advanced search based on most available fields
search results simple display, showing a reasonable set of fields
search results advanced display, showing large or configurable set of
fields
simple display, showing most commonly desired fields
advanced display, showing all data
add new record simple, requesting most commonly entered fields
add new record advanced, allowing all fields to be manipulated
edit existing record simple
edit existing record advanced
editing for each of the 'master' tables
All edit/add screens need pulldowns for master lists allowing one to
be selected, search screens need pulldowns allowing multiple to be
selected. The user should not be burdened by the underlying layout of
thed tabase.
I want something to do most of the grunt work of:
all the CGI stuff, of course
authentication and maintaining the session
building the forms. ugly is ok as long as it's usable. optional
templating would be nice.
working with the database
After everything is done modifying the interface to accomidate a new
table or new column in an existing table should be trivial.
I appreciate any advice about the most efficient way to develop such
systems.
- 3
- Hi iam bavaniHi iam bavani
life is the first gift
love is thesecond
understanding is the third
****************************************
htt:"my profile 22 blogs pot.com
**********************************************
username:bavanikumar22
***********************************************
- 4
- How can I do a barebones version of a source file?I need to create a barebones version of my Java source files.
What I mean when I say "barebones" is this: I have, for example, this class:
----8<--------8<--------8<--------8<--------8<--------8<--------8<----
package cl.cl.cl;
import cl.lc.*;
import java.util.*;
public class demo {
public String salute="Hello, World!";
private String somethingElse="";
public void SayHello() {
System.out.println(":::"+salute+":::");
// ... a lot of code ...
}
public int RealAge(Person p) {
// ... a lot of code ...
return theStuffIJustCalculated;
}
public Person[] Friends(Person p) {
// ... a lot of code ...
return theArray[];
}
}
----8<--------8<--------8<--------8<--------8<--------8<--------8<----
The barebones version would be:
----8<--------8<--------8<--------8<--------8<--------8<--------8<----
package cl.cl.cl;
import cl.lc.*;
import java.util.*;
public class demo {
public String salute="Hello, World!";
public void SayHello() { }
public int RealAge(Person p) { return 0; }
public Person[] Friends(Person p) { return null; }
}
----8<--------8<--------8<--------8<--------8<--------8<--------8<----
It would keep all the public/protected (not the private) attributes, methods,
etcetera, but only the declarations and no code inside the methods. The methods
that return something return a zero or a null value.
My intention is to be able to compile the entire set of source files, even if
there isn't any "meat" in them.
I wrote a Perl script, using pattern matching, but it's pretty crude and won't
handle properly stuff like more than one modifier for an attribute or a method,
or inner classes.
I'm wondering if this has been solved before. Do you know about a tool that does
what I'm trying to do?
Thanks in advance.
--
Miguel Farah
email***@***.com
- 5
- WSIF and format:typemapping questionsHi to all of you,
I have to use wsif to call java, ejb and jms bindings. I wonna use
<format:typeMapping> extension to convert from xml to my custom Java
object. But somehow I cann not. Samples in WSIF zip are not enough to
solve my problems. Could someone give good tutorial or share his/her
experiense.
10x jajoo :)
- 6
- grant execute file permission to a JSP? I'm trying to run an external command from a JSP and instead get
the exception:
java.security.AccessControlException: access denied (java.io.FilePermission /usr/bin/killall execute)
which seems clear enough. (The code runs and works from within a
console application.)
The OS is Linux and the application server is the one that
installs with the J2EE sdk from Sun. It is installed within my
home directory and runs under my user ID exposing deployed JSPs
at http://localhost:8080/
I've added the following code to both my ~/.java.policy file and
the ${java.home}/jdk/jre/lib/security/java.policy file:
grant codeBase "http://localhost:8080/-" {
permission java.io.FilePermission "/usr/bin/killall", "execute";
permission java.security.AllPermission;
};
Neither of the entries in either of the files makes any
difference. The only change I've made that has any affect at all
is to change the command from 'killall ...' to '/usr/bin/killall
...' which changed the file reference in the exception from "<<ALL
FILES>>" to "/usr/bin/killall".
Each time I made a change in the policy files, I restarted the
application server to make sure it was using the new file contents.
I'm clearly overlooking something or have something wrong. Any
suggestions on how to resolve this would be most welcomed!
thanks,
hank
- 7
- 8
- Failed to load or instantiate TagExtraInfo classI am using struts-1.3.8 tiles together with Spring, now I wanted to
implement my own custom tag. Following a book example, I wrote a
TagHandler that extends "SimpleTagSupport". Eclipse told me I needed
to import the jsp-api.2.0.jar from tomcat, so I did.
However, this always results in the error:
org.apache.jasper.JasperException: /WEB-INF/jsp/myjsp.jsp(1,1) Unable
to read TLD "META-INF/tld/struts-tiles.tld" from JAR file
"file:myFileLocation": org.apache.jasper.JasperException: Failed to
load or instantiate TagExtraInfo class:
org.apache.struts.tiles.taglib.UseAttributeTei
I did some research on the web, there it's said not to include the jsp-
api.2.0.jar (but not why not to), and yes, this solves the problem -
but how can I implement my Tag handler without using this jar file?
Eclipse doesn't find the required classes otherwise...
Thanks in advance,
Christine
- 9
- is it possible to use a backslash as a StringTokenizer delimiter?I am trying to tokenize a file path to compare it to another.
i.e tokenize: ways\gov\marketing.fls
to compare each directory seperately.
Is it possible to use the "\" (backslash) character as a StringTokenizer
delimiter, and if so how?
if not, any ideas on how to seperate this string?
Any help greatly appreciated
Thanks
Greenz
- 10
- Tomcat4 RMI class loading bermuda triangleHi every body,
I'm trying to fix this problem for one week and i'm turning crazy
right now.
I have this servlet working perfectly, finding every package i put in
/var/tomcat4/shared/lib except that it doesn't find my RMIServer class
for casting
i get a
[java.lang.ClassNotFoundException] - myRMIServerClass
org.apache.catalina.loader.StandardClassLoader.loadClass(Unknown
Source)
org.apache.catalina.loader.StandardClassLoader.loadClass(Unknown
Source)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:141)
all classes are in the jar with the stub and skeleton (i tried to put
classes in WEB_INF/classes of my servlet but same problem... so i
guess this is not the real problem)
I have set in catalina policy file a:
grant {
permission java.security.AllPermission;
};
to be sure there's no problem of security. i changed the
init.d/tomcat4 script to add -security to the starting line to be sure
that it is started the right way
i used to try the same code with tomcat 3 and i changed to tomcat 4
because of a rmi jni problem reported on mailing lists (i spent so
much time on tomcat4 that i can't remember what was the previous one)
but i can't even get that far with tomcat4
my version is a rpm 4.2.1 for Red Hat
does someone understand what's going on
- 11
- Bug#348398: Make her horny for youThe real trophy for her is what lies in your pants.
http://www.Steiplas.com/
Please don't forget this
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 12
- log4j with OpenJMS
Anybody got sample code for sending log4j messages specifically to OpenJMS?
In particular I'd like to do it all programmatically, since I'm working with a fairly complex pre-existing build system and would rather not start introducing too many new properties files. I have a log4j.properties file, but I'm trying to avoid having to create a jndi.properties file.
I stuck this code from OpenJMS in my Logging utility (which wraps log4j):
Hashtable properties = new Hashtable();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.InitialContextFactory");
properties.put(Context.PROVIDER_URL, "rmi://localhost:1099/");
Context context = new InitialContext(properties);
and log4j.properties has a simple:
log4j.myLogger=DEBUG, JMS1
log4j.appender.JMS1=org.apache.log4j.net.JMSAppender
log4j.appender.JMS1.TopicBindingName=testtopic
log4j.appender.JMS1.TopicConnectionFactoryBindingName=JmsTopicConnectionFactory
I keep getting the error "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial" which leads me to believe that my block of code is not storing the InitialContext in a way so that log4j can get at it.
Thanks!
- 13
- Problems in xml parsingHi,
I am using XMLTool.java to convert an xml file into an xml document
and
I am parsing the xml file using Nodelist and Nodes.
NodeList ls = getElementsByTagName("xxx").
Its working fine when I am running my application in windows.
But when I am running the same application in unix, I am getting
exceptions while parsing. Its giving null value and I cannot proceed
further.
Can anybody pls suggest where I am doing wrong?
I appreciate your help.
Regards,
Hari.
- 14
- executing data needs mprotect with PROT_EXECThis is a multi-part message in MIME format.
I've been trying to run some FreeBSD4 packages
inside a jail on a FreeBSD6 / amd64 box; and I've
hit a problem with ports/jdk.
A couple of places the VM uses an array of
integers, puts code in it, and executes it.
This doesn't work on machines where the CPU
honors the PROT_EXEC settings; this can be
different on different machines (depending on
BIOS settings probably).
The right fix is to call mprotect() from jdk to allow
execution of the memory in question, something like this:
--- ../../hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp Tue Feb
14 21:12:46 2006
+++ ../../hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp Wed Feb
15 16:30:49 2006
@@ -561,6 +562,9 @@
}
#else
static void (*fixcw)(void) = CAST_TO_FN_PTR(void (*)(void),
code_template);
+
+ ::mprotect((void *)code_template, sizeof(code_template),
+ PROT_EXEC | PROT_READ | PROT_WRITE);
#endif
fixcw();
--- ../../hotspot/src/cpu/i486/vm/vm_version_i486.cpp Thu Sep 11
03:40:14 2003
+++ ../../hotspot/src/cpu/i486/vm/vm_version_i486.cpp Tue Feb 14
23:34:40 2006
@@ -9,6 +9,8 @@
# include "incls/_precompiled.incl"
# include "incls/_vm_version_i486.cpp.incl"
+#include <sys/types.h>
+#include <sys/mman.h>
int VM_Version::_cpu;
int VM_Version::_cpuFeatures;
@@ -145,6 +147,10 @@
ResourceMark rm;
// Making this stub must be FIRST use of assembler
CodeBuffer* c = new CodeBuffer(address(stubCode), sizeof(stubCode));
+
+ ::mprotect((void *)stubCode, sizeof(stubCode),
+ PROT_EXEC | PROT_READ | PROT_WRITE);
+
VM_Version_StubGenerator g(c);
getPsrInfo_stub = CAST_TO_FN_PTR(_getPsrInfo_stub_t,
g.generate_getPsrInfo());
patches also attached in case the mail client mangles them :-)
- Arne H. J.
- 15
- Refinement of a Java prog called by PHPAfter listening to everybody's replies, I rephrase my problems as follows:
I modify my program from my client:
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection ( "jdbc:mysql://127.0.0.1/" +
dbstr, "root","");
...
after a series of search in the db "dbstr",
I want to return result from the search obtained by this Java program by
simply using System.out.printIn because I tried a C program and printf
simply works.
In order to make sure the java program can be called by PHP successfully, i
place it under the php directory instead of calling
system(java_prog_absolute_path/the_java_prog);
And the error returns from the java "slave" prog to the "master" php prog
is:
the error is:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at
java.net.URLClassLoader$1.run(URLClassLoader.java:200) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at
java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:169) at
SearchDatabase4.(SearchDatabase4.java:74) at
SearchDatabase4.main(SearchDatabase4.java:344)
And the file SearchDatabase4.java is:
74: Class.forName("com.mysql.jdbc.Driver");
344: new SearchDatabase4(args[0], Double.parseDouble(args[1]),
|
|
|