java,jsp,batch-fileRelated issues-Collection of common programming errors
Preetygeek
java c++ winforms jni
So, i have visual studio consloe project that compile to .dll file. I’ve created simple windows form System::Windows::Forms::FormI’ve created a .java file:import java.io.Serializable;public class MyBean implements Serializable{/*** */static{System.loadLibrary(“MyBean”); }private static final long serialVersionUID = 1L;private static native String getDateCpp();public String getDate(){return getDateCpp();}}compiled it and generate a .h file by javah:/* DO NOT EDIT THIS FILE – it is machine genera
Felix
java javassist
With Javassist, is there any way to inject code into a native method? In this case, I’m trying to make the OpenGL calls in my game print out their names and values when called, but all my attempts have hit errors when I assume the openGL dll code is added.The method would look something like:public static native void glEnable(int paramInt);Since the methods initially have no body, the only way I’ve found to actually add the code is with something like:CtBehavior method = cl.getDeclaredBehaviors(
Can Eldem
java eclipse leap-motion
I have a project that uses leap motion sdk. I wrote this project in Eclipse. When I run my program I don’t have any problem because I set my native libraries as it is suggested from configuration. However, when I export my application I can not run my program because Eclipse does not include my native libraries and I am having this error. Native code library failed to load. java.lang.UnsatisfiedLinkError: no LeapJava in java.library.pathMy purpose is create a .jar file which user can run with o
Arturs
java android upnp
From Android 4.1 (under Wi-Fi Direct service discovery) it is suppose to support native UPnP service discovery.I presume it was developed for Wi-Fi Direct, but the methods available seem to be generic. Even the JavaDoc for methods mention that it searches for all UPnP services on the network and not only WiFi Direct slaves/masters.However, I am failing to implement it so that it works… I manage to set up all requirements and I get positive onSuccess callbacks, but I receive no onUpnpServiceAva
TheEnemyOfQuality
java dll linker jni
I’ve got a bit of an odd problem. I have a project in C++ that’s basically a wrapper for a third party DLL like this:MyLibrary –loads DLL_A —-loads DLL_BI load DLL_A with LoadLibrary(), wrap several of its functions and generate my own DLL. I’ve tested this in a C++ project and a C# project. Both do everything they’re supposed to do: load DLL_A, make a couple of function calls, and indirectly load DLL_B. The problem is when I build a DLL for java and make the calls through JNI. Everything run
user614454
java android https
I am trying to make a HTTPS call using Java to a browser that uses the native login prompt.http://blog.stevensanderson.com/2008/08/25/using-the-browsers-native-login-prompt/Currently I’m using the below for HTTP and it works fine for other websites since I know the parameters to put in…however it fails for the above type of login (I am not sure how to capture the parameters…it’s a login pop up..or if this is even the correct approach)….any ideas??..thanksHttpUtility.sendPostRequest(request
Karel Petranek
java java-web-start java-native-interface
I am using Java Web Start to launch a Java application that depends on some third party native libraries. These native libraries then subsequently load another native library (commonLib) as their dependency using LoadLibrary/dlopen.When not using Web Start, everything works as expected when the native libraries are located in the same directory.Web Start, however, requires the native libraries to be packed in a jar file and referenced in the jnlp file, which I did:<!– Windows OS –><re
MvG
lion java 32-bit
MotivationI have a proprietary java application which used to work under Snow Leopard but fails under Lion with the following backtrace:Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: Invalid display modeat apple.awt.CGraphicsDevice.setDisplayMode(CGraphicsDevice.java:472)at apple.awt.CGraphicsDevice.setFullScreenWindowSynchronized(CGraphicsDevice.java:363)at apple.awt.CGraphicsDevice.access$000(CGraphicsDevice.java:25)at apple.awt.CGraphicsDevice$1SetFullScreenAction.
Arne
java sql hibernate hsqldb
I use HSQLDB and Hibernate. I have to implement some functionality on database level (trigger …) and because of this I have to execute some native SQL. I create a new table (works) and then try to insert some data (fails). I do this as SA such there should be no access right violation. Someone can guess why the user lacks privilege or object not found: A492Interface is thrown?This is my code (simplified):session.createSQLQuery(“CREATE TABLE entity_table_map (entity_name VARCHAR(50) NOT NULL PR
user3299028
java hadoop native-code
I am having issues while running job with large data (~15G) on hadoop cluster using SimString Native library. However job runs fine on medium/small dataset(~200M). During the job SimString first create a file based database for matching strings and then perform matching on a given String against strings in database. After job is completed it deletes the file-based database. The job runs in a multi-threaded(100 threads) fashion.Around 22 mappers are created for job execution, each running 100 thr
Matthew Flaschen
java forms jsp parameters request-object
I have done some research, and majority of the examples I have found use forms (obviously for user input) to collect data which is then passed to another JSP page through the request object.My question is: “Is it possible to pass a parameter between JSP pages IF the parameter hasn’t been set in HTML tags?”Thankyou, Lucas
Santino ‘Sonny’ Corleone
javascript html jsp
I have this code<script>var database=”<%=rsta2.getString(“data”).replaceAll(“[\\t\\n\\r]”,”<br />”)%>”;var newTextBoxDiv = $(document.createElement(‘div’)).attr(“id”, ‘TextBoxDiv’ + counter);newTextBoxDiv.after().html(‘<textarea rows=”15″ cols=”70″ name=”textbox’ + counter + ‘” id=”textbox” >’ + database + ‘</textarea>’)newTextBoxDiv.appendTo(“#TextBoxesGroup”);counter++; </script><body><div id=TextBoxesGroup></div></body>Initially I ad
Majid Abarghooei
java jsp keystore sslexception
I’m trying to post data to a payment gateway website with the following jsp code:System.setProperty(“javax.net.ssl.trustStore “,”C:\\Program Files\\Java\\jdk1.7.0_17\\jre\\lib\\security\\cacerts”);\ System.setProperty(“javax.net.ssl.trustStorePassword”,”changeit”);URL server = new URL(“https://…”);HttpURLConnection connection = (HttpURLConnection) server.openConnection();connection.setRequestMethod(“POST”); connection.setDoOutput(true); connection.setRequestProperty(“content-type”,”application
Timothy Carter
php javascript jsp splash-screen
I want to know how to show a splash screen (like a gif or jpeg file) on the user screen during my script execution.Thank you for your help.
Alex
java jsp jboss jstl stripes
In a Java web application I am using the Stripes framework on Jboss 4.2.3. In my JSP when I use<c:import url=”http://localhost:8080/contextPath/txts/someID” charEncoding=”UTF-8″/>It works great and the the contents are included in the output HTML. However, this does not work <c:import url=”/txts/someID” charEncoding=”UTF-8″/>and it throws this error (the whole stack is too big to paste here, so I include the first few lines):java.lang.IllegalStateException: Unexpected internal error
RishiPatel
java jsp servlets
I need to verify the email. I want to do it by generating a unique string and making a link of it for users to click on it in the mail. I dont know how to generate it using Java. There are md5, sha1 etc functions in php to generate the string using any unique value like email. Is there same function provided in jsp? Advice please.thank you
kehinde
mysql sql hibernate jsp batch-file
I have been on this for a couple of days, no solution. I pray somebody gives an adequate answer to get this resolved. It’ll really be an accomplishment. What I want to achieve There are only three (3) controls on the interface – a dropdown, an input, and a submit button. The dropdown gets its values from a column (ownerName) in a table in the database. To perform a transaction from the interface, a value is selected from the dropdown, a value is inputted into the input box (textbox) which is t
Alex Martelli
javascript ajax jsp dojo dojo.data
Using a form in a dialog box I am using Dojo in jsp to save the form in my database. After that request is completed using dojo.xhrPost() I am sending in another request to update a dropdown box that should include the added form object that was just saved, but for some reason the request to update the dropdown is executed before saving the form in the database even though the form save is called first. Using Firebug I can see that the getLocations() request is completed before the sendForm() re
aksamit
java jsp struts2 struts
I am following the Struts 2 Tutorial – Using Struts 2 TagsSo far everything have been working as expected until I added the following to index.jsp:<s:url action=”hello” var=”helloLink”><s:param name=”userName”>Bruce Phillips</s:param> </s:url> <p><a href=”${helloLink}”>Hello Bruce Phillips</a></p>Expected result is that the anchor-link (Hello Bruce Phillips) should be substituted with corresponding URL for hello.action with parameter userName encod
DarkKnightFan
ajax jsp struts2 servlet-filters session-timeout
I am making ajax calls from my JS methods to invoke the action class’s methods in the following manner:$.getJSON(“treeDemo_!getRootNode?appId=” + applicationId, function () {}).success(function (e) {}).error(function (jqXHR, textStatus, errorThrown) {alert(textStatus);}).complete(function () {});Session configuration in my web.xml looks like this<session-config><session-timeout>1</session-timeout> </session-config>Now when the session expires after 1 minute, the ajax call
GK-F3D
batch-file cmd cmd.exe
for /F “skip=n tokens=3 delims= ” %%i in (myfile.txt) do echo %%iIs it possible for skip=n … to be a variable like skip=%test% … where %test% has an integer value?So I’m trying to add a column of data and the location of this table in the file is given by a string. For Eg: $startTable 0 1 41 2 42 1 4 $endTable So the location of this table is given by the line number associated with $startTable. I have the value of this stored in a variable(!test!) so I need the skip=!test! and then I start
Toni Toni Chopper
windows batch-file cmd
I have a which.bat on Windows 7,@echo off REM This bat searches a file in PATH list to see whether a file can be found. REM If found, it shows the file’s full path. REM which.bat gcc.exe REM shows REM gcc.exe is found: D:\GMU\MinGW2\bin\gcc.exe REM REM Note: Filename extension is significant in the search. E.g. If you run REM which.bat gcc REM gcc.exe will not be matched.IF “%1” == “” goto ENDIF “%~$PATH:1” == “” (echo %1 is not found in any directories from PATH env-var.) ELSE (ech
EpicTonic
windows batch-file cmd
-BASIC INFORMATION I have this sourceforge project called E-Series which makes certain coding tasks more easier, in this question I’ll specifically be talking about “Easy Command Line” from E-Series.-NOTES-Once again, In the title as well, calling the batch file from original cmd (Access it by going to Run>cmd) does work, however calling it from a .bat file designed to call it does not.-the batch file i’m calling has parameters.-WHAT I’VE GOTHERE are all the files required to run the whol
Martin Brown
windows datetime formatting batch-file
In a windows (XP) batch script I need to format the current date and time for later use in files names etc.,Similar to How to append a date in batch files but with time in as wellI have this so far:echo %DATE% echo %TIME% set datetimef=%date:~-4%_%date:~3,2%_%date:~0,2%__%time:~0,2%_%time:~3,2%_%time:~6,2% echo %datetimef%which gives:28/07/20098:35:31.01 2009_07_28__ 8_36_01Is there anyway I can allow for single digit hour in %TIME% so I can get:2009_07_28__08_36_01
APerson
windows parameters batch-file dos
In Windows, how do you access arguments passed when a batch file is run? For example, let’s say I have a program named hello.bat. When I enter hello -a at a DOS command line, how do I let my program know that -a was passed in as an argument?
Darrrrrren
batch-file dos
I have, say, ten images that I’d like to rename in a looping fashion every night. I’ve written a batch file that does the following:@echo off cls ren image10.jpg imagetemp.jpg ren image1.jpg image10.jpg ren image2.jpg image1.jpg ren image3.jpg image2.jpg ren image4.jpg image3.jpg ren image5.jpg image4.jpg ren image6.jpg image5.jpg ren image7.jpg image6.jpg ren image8.jpg image7.jpg ren image9.jpg image8.jpg ren imagetemp.jpg image9.jpg exitI’d like to rewrite this to be a loop since my image co
stivlo
networking loops batch-file windows-xp
I am trying to write a batch script with a section that ouputs your drive mappings to a text file, so i can restore it later once i wipe out the machine. I came up with this for loop to do it, but its acting differently when its a batch script versus running the command itself.This is the actual line of code:FOR /F “tokens=1,2” %i in (H:\mappings2.dat) do @echo %i %jWhen i copy and paste the command from the script to the command window it works fine. When I run the batch script from a command w
Stuart Brown
batch-file for-loop cmd windows-server-2008-r2
I have a DOS build script which works on one Windows Server 2008 R2 but not another. To see the symptoms on the broken machine entering either of the following at the command line: for /f %X in (‘dir /b *.txt’) do @echo %X for /f “usebackq” %X in (`dir /b *.txt`) do @echo %Xgives: “‘dir /b *.txt’ is not recognised as an internal or external command.” while e.g.for %X in (*.txt) do @echo %Xworks fine, so the /f is not being obeyed properly. I don’t believe this is the Command Extensions themselve
Bonzo
batch-file
I have very little experiance of batch files and have cobbled this together from other files I have written.The batch file will have a folder of images dropped over the icon and should carry out different resizing depending on the photo oriantation.The dos window closes before I can read any errors.If I have the convert or identify lines only ( one at a time ) within the loop it works but with the if else it fails. With the IF ELSE activated the opening parentheses after the DO does not highligh
Ricky Hewitt
windows batch-file
I know this question has been asked a few times on SO, but for whatever reason, those answers did not solve my issues. The offending code is below. I am running it from a .bat file.@echo offgoto :getSystemID:getSystemID set /p systemId=”Please input the System ID – Example ‘DD012345-xxxx’ : ” %=%:getLocation set /p isBackup=”Is This a Backup Location? Backup Locations use 169.254.xxx.x (Y/N) : ” %=%if [/i] “%isBackup%”==”y” (set primaryIP = 169.254.xxx.xgoto :end ):end echo %isBackup%Reguarless
Web site is in building