I have been trying to find all day long a way to secure my .ear file from modifications made by third parties... My product is packaged as an .ear file which i send for deployment to other administrators. What i am looking for is a way to "sign" my version of .ear versus the deployed version of .ear to be sure that no modification has been made to my code...
This is the code that i have used to delete particular String from text file. It works absolutely fine on eclipse and netbeans.. But on deployment(in tomcat) it fails to delete message/rename or delete original file even though all permissions for modifying the files in the folder has been given to all users.
In reference to the book "Head First Servlets and JSP, 2nd edition", chapter-3(), page-81, the command to compile the servlet file to the desired location is
(from the same directory as can be confirmed from the attachment of screenshot of error). this code is in accordance to the location of the respective files in my system, in particular the servlet-api.jar file.
After doing this, my computer is showing the error : file not found.
How do I resolve this? Actually, I don't understand completely what this code is trying to accomplish.
To deploy my project into %TOMCAT_HOME%webapps folder. Right click on Project ->Export-> War File Project Name: Hello Destination: D:Program FilesApache Software FoundationTomcat 6.0webappsHello.war
Result found in web browser:
HTTP Status 404 - /Hello/first And Hello.war file is not found in webapps folder too after exporting as .war. I am using Apache tomcat 6.0.37, eclipse 3.7.2 release, tomcat plugin :com.sysdeo.eclipse.tomcat_3.3.0
I have followed the Java tutorial on JAAS Authentication and Authorization. All the sample code in the tutorials works fine also when running under a security manager. Now I am trying to modify the LoginModule class, so that it uses a password file to look up users and passwords, but as soon as I try to run the code under a security manager, I get a Security Exception. I suppose it has something to do with the code havent been granted any access to read the password file? So I tried to add this to the policy file:
grant codebase "file:./sample/module/-" { permission java.io.FilePermission "sample/module/passwords.txt", "read"; };
It didn't do any difference. why I get this Security Exception?
The only difference from my code to the tutorial code, is that I have added the lines:
currently I am doing my java web application project ,and it has following steps 1) Upload the txt files 2) java servlet gets the txt file's url , read the data and do the calculation 3) pass the results
I almost finished the second step , and working on the first step .Since there are so many input files at a given time , i have to use drag and drop method to get the file's location.how to pass file's path to servlet.( servlet code can read the data from the given txt file path )software used - tomcat and netbeans 8.0
I have tried running the java application without adding the site to site list in java security tab. But I get a sand box message as APPLICATION BLOCKED BY SECURITY SETTINGS. How to run the java application without adding the site to site list in java security tab.
But when i try to open it i get the message: Application Blocked. Click for details.
- The list i see doesn't work - If i click Ignore nothing happens - If i click reload nothing happens
When i read and search the net i have to change my java security settings. The security setting are HIGH and i cannot change that.But i can fill in an Exception Site List...The hello.html file is on my NAS : file:///X:/Lantronix/hello.html..I fill this in the exception Site list -> I get a message that it is a security risk to add this location.
How to force browser to open/save/save as the file from server instead of browser cache.
I am creating a csv file through a pl/sql procedure and forwarding the link to user once user clicks on link he downloads the file, however if the same thing is repeated then browser returns the old cached file instead of new file generated on server.
I have implemented a deployment rule set for our JRE enterprise deployments and it is working fine. We are currently deploying JRE version 1.8.0_25. I have stumbled upon a Java App (a webcam) on an internet site that I cannot get to run with the deployment rule set.
The rule set works with other java apps, but it’s as though it is ignored for this one. The rule set section in the ruleset.xml with the intention of allowing the webcam to work is as follows:
<rule> <id location="IP Address of I assume the webcam, address specified in error when launching app" /> <action permission="run" /> </rule> <rule> <id location="URL of website hosting the webcam" /> <action permission="run" /> </rule>
I pulled it out of the deployment rule set and added it to the exception list without any luck getting it to work that way. How I can get this app to work with my Deployment Rule Set?
I am a JSP/Servlet newbie currently adding the first servlets to a web site that had been static all along. My local instance worked great but the servlets did not respond on the test instance. Apparently, my hosting service provider requires me to use an invoker servlet mapping.
Adding this to local web.xml broke the application but the servlets respond on test instance (when their calls are not preceded by another servlet call). A Servlet fails when it is called immediately after another servlet has been called.
What I saw happening on test is URL for first call is of the form:
The servlets are invoked using "href=servlet/<servlet-name>?Id="
How can I avoid the inclusion of 'servlet' in the URL and reset the URL to the JSP page it navigates to after processing of the servlet?
P.S.: I am also trying to enable the Invoker servlet on local so I can troubleshoot easier. I went through the changes to Tomcat's web.xml and context.xml. However, my local servlets did not respond even after calling them using "href=<servlet-name>?Id=". Is there a way I can check if my invoker is active?
I am having an issue that I cannot seem to resolve with Ant deployments and my Classpath.
I have a module that is needed to run with Open Wonderland but for some reason when I run this particular module deployment it doesn't recognize part of the classpath.
On my server I have a class called JadeRunner.class and it is included in my classpath. I can verify but running the following code:
public class testClassPath{ public static void main(String args[]){ String classArg = args[0]; try{ Class testClass = Class.forName(classArg); }catch(ClassNotFoundException e){ e.printStackTrace(); } } }
I just enter the name of the class as an argument and if I get no errors that it can find the class. This works if I enter it directly from the command line. However with my ant deployment I get a ClassNotFoundException for this class. I run my ant deployment as root but I use the -E switch so it picks up my environment variables. The ant deployment finds all my other environment variables except this one.
I have some sample outputs:
$ java testClassPath org.jdesktop.wonderland.modules.mas.jade.weblib.JadeRunner (this give no output, so it finds the class) $ sudo -E java testClassPath org.jdesktop.wonderland.modules.mas.jade.weblib.JadeRunner (again no output, so it finds the class) $ sudo -E ant deploy
This gives ClassNotFoundException: org.jdesktop.wonderland.modules.mas.jade.weblib.JadeRunner
How do I get java to tell me what it thinks the current deployment configuration properties are? I'm aware of Deployment Configuration File and Properties and see it tells me what the values are, how to set them, etc. But what I want is a way to run java and have it cough up what it's currently using. Something like 'java -display-config-properties' and have it spit out all current values it's using.
I have a signed certificate from Entrust which I used to sign a DeploymentRuleSet.xml file. I placed the DeploymentRuleSet.jar in the proper location C:WindowsSunJavaDeployment, afterward the java control panel's security tab shows a link to "show the active deployment rule set" which did not exist prior to coping the file to the directory. When I click on the link a new window opens and says "Rule Set not found" ....
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?
Modify the program in Assign4 to synchronize access to the instance variable, balance. Save the program as SyncBank.java. Because balance is a double and not an object, it cannot be used as the monitor. Use synchronized methods or synchronized blocks of code as appropriate. Simultaneously test two threads as was done in Assign4. Because the threads can complete too quickly to determine if they are interfering with each other, delay the adding of a deposit by inserting the following code within the synchronized block or method:
Using Eclipse I have imported a WAR with source. I have exported that project as a new war and it ran fine. I then added my own package and exported the war again. The jar file does not show up in /WEB-INF/lib folder. When I deploy the war on a tomcat server it barfs the following error:
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.sharpline.fields.form.fields.TextAreaFormType] for bean with name 'com.sharpline.fields.form.fields.TextAreaFormType#53c37' defined in ServletContext resource [WEB-INF/activiti-standalone-context.xml]; nested exception is java.lang.ClassNotFoundException:
[Code] .....
It looks to me like my class (jar) is missing in the final war. How do I resolve this?
Actually I am working on java ee6 web application i tried to set value and max age for the cookie...but I was unable to set maxage what ever the max age value i give .it shows as -1.but my browser accepts and stores cookie.
using HttpServlet methods. What I want to do is to delay an HttpServletResponse. I set up some response.setHeader but then I want to wait a while after setting other values as the length of data to send and the content itself.
I tried to do that in 2 ways:
1. by using Thread.sleep() - in this case even with sleep of 100 ms the response seems to be lost.
2. by response.wait(TIME) - in this case it will never reach the block after wait, whatever TIME value I use.