Shajid Johnny

Ranch Hand
+ Follow
since May 15, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shajid Johnny

Dear members,

I am not sure whether this is the correct Forum to post in.

I am developing an application with Struts2, Hibernate3 (XML based mapping), MySQL- in Tomcat6.0.20. IDE- Netbeans 6.7
I set the project properties "Deploy On Save" option in Netbeans.

When my application is running, If I make any changes in any part of my application, netbeans console shows the following Error in the
console while auto deploying:



again sometimes while auto deploying, it shows the following errors also:

Illegal access: this web application instance has been stopped already. Could not load java.net.BindException.

or,

Illegal access: this web application instance has been stopped already.
Could not load com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException.


Every now and then it keeps me showing the error and in my development machine (Windows)- I can then re-run the application and make it work.

But the problem is- when I deploy the war in the remote Linux Server, the Application looses the database connection after some period- means no database driven actions are performed.
the results from the database are not shown, only the static resources are displayed. I can't see the log of that server also.

Now, I am not sure if it is a problem with the Hibernate configurations that I have made or any other, so that I am not sure what else should I post here.

I will paste my specific codes here if I anybody suggests.

would anybody point me out what might be going wrong?

Thanks in advance for any help

10 years ago
Dear members,
I am trying to read email and if that email contains any Multipart content, then I want to do some stuff with them.

Here is my code snippet:



the mail content has 3 images in such an order: image001.png is in the first column of a table, image002.png is in the second column of a table, and image003.png is in the third column of a table.
if I print the mailContent- it prints the html of the mail content where the <img src="" > tags are in the order that I mentioned.

but when I print the fileName in method processPart- it DOES NOT print in the proper order. rather it prints

image001
image003
image002

or sometimes in different order!

I am puzzled here!

does not the loop reads the Multipart contents in the proper order? or am I missing something?

thanks in advance
10 years ago
I am trying to access a dll through JNA.
the dll contains a method

I am new to JNA. I tried to went through the tutorials and examples. so far I've understood is- I have done the following thing:

the opensamplesystem() method executes and returns 0 which, according to the dll documentation, is ok.
but the problem is with the startsamplesystem(HWND wid, int mid, int devices, int protocol, int message) where I am not sure how to map HWND data type from my code.

would anyone please show me some way?

thanks in advance
10 years ago
@Stefan Wagner

i am sorry, actually i had to edit the code snippet here, I missed that thing
my code did not have this error. it will be



I got your point. but the thing is- I tested this code in our local linux server and it worked fine!

I guess its a problem related to the permission level of that remote Linux server in which I am trying to deploy.

please be noted that- I set all the folders of the path to chmod=777. but I did not do that physically by logging in with putty or ssh. i did that using an FTP client.

should I try to test the mkdir command after physically logging in to that server by putty?
10 years ago
Hello dear members,
I have no experience with Linux server. I am building a java application which will save files into server, uploaded by users. I have to deploy the application to a remote linux server. but the code of writing a file into that server seems not to be working. later i tried a simple jsp script to test if I can write any file to that server:



the directory var/www/vhosts/mysite.com/httpdocs are already existed in the server. I made all of their chmod = 777 through ftp.
but it does not create the folder and write the file.

I put the code into try catch and printed the exception- it shows:

Exception: java.io.FileNotFoundException: /var/www/vhosts/mysite.com/httpdocs/resources/write.txt (Permission denied)

can anyone please point me out my mistake if any? what could be the solution?

thanks in advance
10 years ago
Hello dear members,
I am working on modifying and enhancing an existing application which is built on Struts (for MVC) , Spring (for Service layer), Tomcat App Server.
in the application, there is a Job Scheduler defined if the ApplicationContext.xml which i am showing bellow:



when i run the application, it shows the following error:


even if i remove the reference , still it shows the above error.

i am new to Spring, and all i have is a basic knowledge on Spring Job scheduler. but i don't get the clue what to do here.

would anybody please give me some hint?
Thanks in advance
10 years ago
Thanks Ernest!
Thanks Rob!

yes, JNA has the answer to my need. i am trying that. lets see if i can do this.

thanks again
10 years ago
Thanks Rob!

Rob Prime wrote:
Can you show us your .h and .c files as well? You can leave out the body of the .c file's functions but we need to see the signatures of those methods as well.



you know, this is where i have always been confused! all the tutorials i went through on the topic "how to integrate dll in java/JNI" described things in following manner:

1) write a java class which loads the dll in a static block, and invoke the native method
2) compile and create a header file of that java class
3) write a .c/.cpp which includes the header file of the java class, and implements the native method maintaining the exact signature
4) compile the .c/.cpp file
5) run the java class


but this is not my case. in my case there is a dll named- PaymentManager.dll written in C++ , we need to build a KIOSK payment system implementing the functions of that dll. i do NOT have the .cpp file. all i have is the documentation of that dll which describes the API of the functions, some of them i've already mentioned previously.

the documentation says, there is a function to open the PanymaneManager:
& my generated header file is:


so my question is: Can't i do what i am trying to do? do i need the .cpp file of the dll to invoke its methods? is #3 and #4 points above is mandatory to implement JNI??
10 years ago
dear members,
i am trying to use some dll methods from java through JNI.

the documentation i got with the dll clearly explained the method api, i am providing some:



to use them, i have written a java class: TestDLL.java:



i placed my PaymentManager.dll in windows/system32 directory.
i compiled the class, made a header file of that. when i tried to run the class- the dll file gets loaded successfully, but the method is not invoked. i know there is an issue- the signature of the dll native method and my called method must be exactly same. i took a good care of that. but every time the console gives the following error:



notice the console error message: at the end of the method- a text I is appended. so is that the reason behind the error?

would anyone please help me on this?
10 years ago
Hello dear members,

I am using displayTag for pagination and sorting. I want the rows to get sorted asc/desc when i click on the column title.
my display Table code is as bellow:


there are more columns as well.

in the Action class- i have the following code to read according which column it will get sorted:



now when i print sortBy- it always prints null. means no value has been read from the parameter.

can anyone please point me out if i am doing some mistake? or if any changes needed?

thanks in advance
Dear members,
I want to open an existing application in Netbeans 6.7 which is build on

Spring 2.5 and Struts 1.3 and JBoss app server


i had jdk1.6 installed on my machine. when i tried to add JBoss server 5.0 , Netbeans showed me following message:

Provide a valid JBoss Application Server 4 or 5 location

I googled, and found very few threads on this. didn't get perfect solution. then I tried JBoss 4, didn't work either.

later I downgraded my JDK to 1.5. tried with JBoss4 also didn't work.

Now i am totally frustrated. is this a bug of Netbeans? or I am missing something on version compatibility of the technologies?

could you please show me some light on this?

Thanks in advance
10 years ago
is my ugly photo attached here & thats why people are just visiting by but not feeling interested to show me some light??
i am really upset :-(
Dear members,
I am displaying table data using displaytag where i define pagesize=15

the struts action that i use (along with the appended parameters) is: showAllTheArticle.action?user.id=1&user.username=admin

the table shows the first 15 record nicely, but when i click on the next/last links- the following hyperlink generates:

pages/AllTheArticle.jsp?d-49309-p=2&user.id=1&user.username=admin
- and the next page shows : Nothing Found to Display , though there are still records to show.

I know there are other options except displayTag, but I have to use it.

so could anyone please tell me what change do i need to make?

Thanks in advance :-)
Hello dear members,
I am developing a struts application in which i want to get user's country name, currency, language etc by their IP address. For this purpose, I used InetAddressLocator methods in the following way:


I imported all necessary classes/jar. It gives the following output:


your IP address: en_**
your country name:
your language name:
your host name: 0:0:0:0:0:0:0:1


I am living in Bangladesh & I am using a real IP address. But no way it shows the proper info.
I checked my IP http://www.geobytes.com/IpLocator.htm?GetLocation and it displays all the informations including country code, capital, city, timezone, currency, currency code etc.

can anyone please point me the problem?

am I using wrong API? if so, then what might be the proper solution?

Thanks in advance :-)
10 years ago

Hello dear members,

I have an entity class Article.java with 3 boolean attributes: spam, miscategorized, prohibited along with some other attributes. I map them to db using Hibernate.

I take user input for the other attributes and save the object. those 3 boolean attributes are set to false initially.

later when the users view the Articles on a jsp page, they see 3 checkboxes: spam, miscategorized, prohibited where they can just check them & the according field will be set to true on the database.

how do I do this? on this view page, the user will not submit any form, they will just view the article content, rate them (if necessary) and go back.
do i need to call a struts action when any checkbox is checked? how do i do that? or is there any other solution?

I really need some help on this :-(

Thanks in advance
10 years ago