We have a custom authorization in our application login page, authorization by using eToken and java (signed jar classes) and applet as login button on page. It's work fine on older and current java versions like 7u67, 7u71 but it's not work on new java version 8u25.
We write a test class named AuthControl without package, we found that problem is in .jar file path, for example:
&APPLET_VERSION. is a jar file name, uploaded using "Shared Components / Static Files - Create"
<script src="https://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'AuthControl',
archive:'#WORKSPACE_IMAGES#&APPLET_VERSION.', width:132, height:37}; // problem in the path to the .jar file
var parameters = { scriptable:true, mode:'login' };
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
Error is:
...
java.lang.ClassNotFoundException: AuthControl
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: load: class AuthControl not found.
...
But if we use a direct path to the jar file, it's work fine without errors, example:
<script src="https://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'AuthControl',
archive:'http://example.com/myapplet.jar', width:132, height:37};
var parameters = { scriptable:true, mode:'login' };
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
We are using an applet in our web application. The applet of our application is dependent on bouncycastle jar,bcprov-jdk15.jar and few other jar's whose size comes around 4 mb. When using the appliaction on jre7, the applet is taking too long time to load than usual time. Is there any way to place these jar's in client machine? Will it improve the performance? Is there any other way to reduce the loading time of applet apart from placing jars in client machine?
I m new to programming and am working on the college project. I have MySQL 5.6.20, Eclipse Kepler and Apache Tomcat 7.0.54. I m trying to retrieve the whole table from MySQL schema into a jsp. All the possible things i can do, i have already tried, but none of them are working.
The following attachment contains the whole project. I have my sql connection code in Sample.java file, which i want to get working in Fetch.jsp on the Submit button click. But it shows the tomcat error as localhost:8080/Sample HTTP Status 404-/Sample ; type Status report; message /Sample; Description The requested resource is not available.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
how I can change my code so that somebody can actually input the specified file path, rather than having it fixed in the code. I previously used
Scanner in = new Scanner(System.in); System.out.println("What is the filename?"); String input = in.nextLine(); File file = new File(input);
But then the program would not display the frequencies.
import java.io.File; import java.util.*; /* This program will allow the user to enter in a text file name, when prompted the program will anaylser the text and display the frequencies */ public class AssP { public static void main(String[] args ) { Scanner scan; try { Scanner scanner = scan = new Scanner(new File("C:/Users/Mary/workspace/Assingment/src/test.txt"));
[code]....
This is my current code and I need to so the user can load their own files.
I am not sure why I am getting this error. The code is not finished at all, but I am stumped on how to get past loading in the things from the text file. Here is my code:
import java.util.Scanner; import java.io.File; import java.io.IOException; public class Hurricanes2 { public static void main(String[] args)throws IOException { //declare and initialize variables
[code]...
It compiles fine, but when I execute it I get this.
The game doesn't seem to be working but you can win by loading a winning saved game.
Hint: Remember that all numbers have a unique set of Prime Factors.
I have been struggling to solve this. The code is not in error. I am trying to load a winning file but unable to solve.
Here is the java code:
import java.math.BigInteger; import java.util.ArrayList; import java.util.HashSet; import java.util.Random; import java.util.Scanner; import java.util.Set; public class Main { static final int GAME_SIZE = 40; //Disk sizes go from 0->39 // Produce a list of the first N prime numbers
[Code] ....
Results:
C:UsersSal_2>java Main Welcome to Towers of Toast!!! Type 'new' to start a new random puzzle Type 'load' to load a saved puzzle new [0, 2, 3, 4, 5, 6, 8, 10, 14, 19, 20, 25, 26, 28, 35, 38, 39] [7, 9, 11, 13, 15, 21, 22, 23, 27, 31, 32] [1, 12, 16, 17, 18, 24, 29, 30, 33, 34, 36, 37] | | XX | | XXX | | XXXX | | XXXXX | | XXXXXX | X XXXXXXXX XXXXXXX XXXXXXXXXXXX XXXXXXXXXX XXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The game is broken! We saved your game, though. Here are your save game numbers:
C:UsersSal_2>java Main Welcome to Towers of Toast!!! Type 'new' to start a new random puzzle Type 'load' to load a saved puzzle load Enter save number for pole 1: 3 Enter save number for pole 2: 1 Enter save number for pole 3: 11 Exception in thread "main" java.lang.RuntimeException: Not all disks accounted f or at Main.main(Main.java:100)
I'm using a PrimeFaces UploadedFile xhtml page to select a csv file to read and write using a managed bean (SuperCSVParser.java). The file is read and written to an entity class which then persists the data to a database. The application works fine if I specify a file path on the physical server and select a csv file on that file path. But for the production version I want the user to select ANY file name from ANY directory on their local system.
I know about the FacesContext methods and I've looked at some methods from the java.io File class. Most of these methods are about getting the path from the server, where I want to 'pass' the path String from the client machine to allow the uploaded file to go through. When I try with the below code I get:
java.io.FileNotFoundException: data.csv (The system cannot find the file specified)
I'd like to know what I'm doing as I prefer not to explicitly declare a path in the final app. I'm almost sure that's possible.
I know that the simple deployment using only applet tags inside HTML causes severe security restriction for the applet on the client side. but can this simple HTML file contains .jar files inside the applet tags instead of .class files.
I am assigned to create a program "Simpletron" that the only language understands it is Simpletron Machine Language or SML. I figured out the most but I get the message "No main methods, applets, or MIDlets found in file" when compiling the program. I pasted my program so that you can see.
The error I get is as follows...When the page is loaded I get the following error: java.lang.SecurityException: class "com.myPackage. test.client. TaskApplet" does not match trust level of other classes in the same package
I want to retrieve file from database which is stored with blob datatype and i am passing manually id associated with in code. Its not retrieving the file.
public class retrieve_image extends HttpServlet { /** * */ private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ResultSet rs = null;
I am having a problem to connect my .exe file to the database(mysql). I used launch4j to convert the jar file to .exe but the jar file can connect to the database when running inside the dist folder. When I run the .exe I am getting this error: No suitable driver found for jdbc:mysql.
I need to read in a file then create the tables and load in the data from the files to the database. I cant seem to figure out how to load the provided text file into the database.it contains lines like this
Boston Americans,AL,Pittsburgh Pirates New York Giants,NL,Philadelphia Athletics etc..
The first line in the field is the name of the team that won in 1903, and the last line is the name of the team that won in 2013. Note that the World Series was not played in 1904 or 1994, so those years are skipped in the file
The program should have a menu that has the following options.
NOTE: the data for choices to e) needs to come from running sql statements on the database tables created in choice a). Not from an ArrayList in memory.
a) Convert the baseball text file to a database table. Ask the user from a dialog box, for the location of the text file. This menu item should create the tables and load up the data.
b)Let the user input a team name, and list all of the years that they won the World Series
c)Let the user input a team name, and list the number of times they won the World Series
d)Let the user input a year, and you list the winner and loser for that year.
e)Add a new winner. The user should supply the winning team name, losing team name and year. Make certain that the year does not yet exist in the table and do not duplicate the team name(s) if they are already in the database tables.
f)Exit
I have two tables teams and games:
Drop table if exists game; Drop table if exists team; CREATE TABLE IF NOT EXISTS game ( yearGame int(11) NOT NULL, winTeam int(11) NOT NULL, lossTeam int(11) NOT NULL,
[Code] ....
I cant figure out how to load the values into the tables as only some of the fields are in the text and and the league field is in a seperate table. Here is my script so far
do { JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("Text/Java files", "txt", "java"); chooser.setFileFilter(filter); int returnVal = chooser.showOpenDialog(null);
I'm given a task to generate an API (a jar file) where the access of a certain database is provided through the API. basic functionality: Client sends a query through the API to server and the Server responds with data.Since its and API, do I have to implement the code or is it enough if i gave just interfaces? what are the OOP concepts to focus on when designing a good API.
I'm using jsf 2 to upload file, first I upload the file in a system directory, then trying to store the path to database with other information, my stuck is that when submitting I upload the file successfully, find it in the right place, find the other information such as description, file name ... in database but don't find the path. this is my managed bean :
I have written my whole java code in netbeans IDE and create database in MYSQL work bench and connected java Gui with this DBMS through requried driver.when i run this program from Netbeans IDE , my program successfully access the data from DBMS. But when i created this java gui exe file its not working and not accessing data from DBMS, and each times gives exception "Driver not found ".if there is no driver loaded in this program how this file is working when i run this file from netbeans .
would like to make .jar application, which will be able to sava data without using any database (Postgres...) but i dont know, what type of datastorage i should use to make the application portable. I just want to .jar file, which is capable works on any computer with java installed. Is there some option?
I am creating an application in core java where i am using database. I need to create a database configuration file & include it all other files. So, how can i do that ?
Java Code:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:MYDSN","system","tiger"); mh_sh_highlight_all('java');
I cannot do this in an interface since only abstract methods exist there. I tried to create an another class file to extend it but my program is already extending other class i.e. javax.swing.JFrame..How can i implement this ? just by creating the object of that class in main method ?
I want to write the image file from a database to disk by using a queue. I can write these images on disk from the result set. I am wrong in the following code? I get: "trying to write to disk: Closed Connection"
{code} public class ExtractPicture implements Runnable{ private BlockingQueue<InputStreamMessage> queue; public ExtractPicture(BlockingQueue<InputStreamMessage> queue){
I want to store an image/file into oracle database using jsp.
I have written code to store data when am running in my machine it is working fine, but not working in server throwing an error saying that "The system cannot find the file specified."
Creating a file upload servlet to accept a CSV and parse for insert into a database, however, whenever I click submit, it always seems to open a new tab/window. Below is the method I have that builds the upload form: (Using GWT 2.4)
private void buildUpload(){ LayoutContainer headerContainer = new LayoutContainer(new ColumnLayout()); headerContainer.setStyleAttribute("padding", "5px"); add(headerContainer); NamedFrame hiddenFrame = new NamedFrame("uploadFrame"); final FormPanel form = new FormPanel(hiddenFrame);
[Code] .....
Is there something I'm missing? or something I've added that makes it open a new tab/window?
I need to print contents of database to excel file.Apache POI is the solution but I am not finding a way to print the DB column names/headers into the excel.
E.g.:
incase csv we have opencsv CSVWriter writer = new CSVWriter(new FileWriter(fileName)); System.out.println("writer"); writer.writeAll(rs, true);
will print the db contents with the column headers dynamically whatever the query may be.
Any solution where we can print data and column names without know the query previously as we are getting query at the run time and each time the query is different.