Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Tumaini Kilimba

Greenhorn
+ Follow
since Nov 15, 2006
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tumaini Kilimba

Dear Sirs et Madames,
I am creating a Java application which creates a CODE 128 barcode then sends the barcode to a Zebra Printer via ZPL. I have created the bit that creates the barcode but am not sure how ZPL is used with Java (I have seen some examples, but I would have to actually know ZPL to understand what command was being sent at all). My current code to create the Code 128 barcode is as so (am using the ZXing Library):



What changes would I need to make to send the barcode to a ZPL zebra printer?

Thanks in advance,
Tumaini





9 years ago
Dear Sirs et Madames,
I am trying to create a Java application which takes a userID and then encrypts it. The code am using is just something I picked up off the net, I have NO experience with encryption. The problem is that even though the string to be encrypted should (and always will be) 10 characters long, the result is always 24 characters. Considering that the encrypted result will be transformed into a barcode, that creates a rather large barcode, unsuitable for my needs. Am sure there must be a way whereby I encrypt a 10 character string and get back a ten character encrypted version? The code I have is as below:



From what I understand, a triple DES key has to be a 24 byte array. What are the alternatives so that the encrypted version I get back is of the same number of characters (or less, if possible) than the original text?

Also, I am not sure as to how well suited this solution is to my problem. Will different Java Virtual Machines produce different keys, meaning that multiple installations will not be able to reproduce the same encryption given the same keyString?

Is there a simpler solution, considering that the only thing I desire is that the USER_ID is obfuscated to the human eye (doctors, nurses, prying eyes cannot tell WHO these blood results belong to, only the system can). In which case is there not a simple(r) obfuscation algorithm I could use?



Thanks in advance,
Tumaini
9 years ago

Tim Holloway wrote:

Myself, I'd probably just write a native Android app that opportunistically contacts a web server via REST or Web Services when it can. Less work, smaller footprint.



I agree with you here, except that in our context, am not developing just 1 app for data collection surveys, they can be as many as 3 a month, and so when I started playing with Spring Roo and realised how quickly you can go from concept to working app in just a few minutes, it interested me, as it would drastically reduce the amounts of time spent on all these various apps,and as we have an abundance of Windows Mobile Hand Held PC's and Android Galaxy Tabs, I was trying to see if a Roo generated GWT app could run on these devices... If it were just the 1 app I was building, I would go with your suggestion though, but the issue is the variety of apps, and the turnaround required.
10 years ago

Tim Holloway wrote:I think there's some confusion here in that the desired goal isn't actually a product that can be executed either as a JAR or a WAR, but just a plain old WAR to execute in a server. So we don't need to worry about a dual-purpose WAR file. Which is good, since the classpaths for JARs and WARs are just different enough to be annoying.



No, I actually DO want to create a war which is executable. Maybe a bit of background is in order... I have created a GWT application for data collection of community health data and I want it to run on a Pocket PC, and/or Android Tablet. The pocket PC can connect and use the application by opening a browser and typing in the appropriate URL of the application (in this case the application is running on a server somewhere, and the pocket PC is just a "dummy terminal". However there will be occasions when there will be no internet connectivity as the setting is rural communities in developing countries, where internet connectivity is a luxury), and on those occasions it would be better if the application ran locally on the Pocket PC or Android Tablet, which would consequently require a web server to serve up the pages on these devices. If I could embed the web server in the war and make the war executable, I can run the application without installing of web server on the device.

Feel free to advise me of alternative ways I can achieve my goal, but at the moment am stuck on executable war file.
10 years ago

Tim Holloway wrote:These are all Jetty internal classes. Jetty is a J2EE container, which means that unless you're actually customizing Jetty, you shouldn't be using a Main class nor importing any of the org.mortbay.jetty packages, since J2EE requires a WAR and use the javax. enterprise APIs not the Jetty-specific implementations.



Am trying to create an executable war (by embedding jetty in the war) as per the following example described HERE... So what are the changes I need to add to my pom.xml to resolve this issue?
10 years ago

Peter Johnson wrote:If you examine an existing executable war file, such as the Jenkins war file, you will notice that it has the attributes of both an executable JAR file and a standard WAR file. Thus if you run it via "java -jar jenkins.war" it runs the enbedded Jetty(?) servlet engine with Jenkins pre-defined. Otherwise, if you deploy it to your favorite app server, it deploys like a standard WAR file.



Ok... so what are you suggesting I should do, please?
10 years ago
Dear all,
My Main class has the following imports:



But each of these imports gives me a warning in Eclipse "The import org.mortbay cannot be resolved"... What are the changes I need to add to my pom.xml to resolve this issue?

Thanks in advance,
10 years ago

Wim Vanni wrote:In my understanding a war-file is exclusively for Java Web Application Servers (e.g. Tomcat). In a way they are already 'executable' because when you deploy a war-file on such a server it will auto-unzip/install/configure/whatever the packaged web application.

It is not possible - not to my knowledge at least - to make it executable like you have an executable jar or like certain file extensions (exe, ...) make a file executable on the operating system.

Cheers,
Wim



There seems to be enough on google to suggest that executable war files are possible, e.g Executable WAR...

Am I barking up the wrong tree?
10 years ago
Dear all,
Am wondering how I can create an executable war file for a maven web application?

Thanks in advance,
10 years ago
Dear all,
am playing around with Spring Roo, specifically running java apps from their roo scripts. Normally this is done by going onto the command shell, navigating to the directory where the *.roo file is, and running the command . This is all done manually. However now I want to run the roo script but from another java application. How can I I get the java application to run the roo script command automatically?
10 years ago

Greg Charles wrote: You have to be careful about buffers and such though.



Thanks Greg... Careful in what sense though?
10 years ago
Dear Sirs et Madames,
I am currently experimenting with Roo, and one thing I would like to change is the banner that Roo creates on the Roo-generated web interface, I would like to use a custom banner. I know I can do this by going to the '**webapp/images**' folder of the generated Roo project and replace the banner image with one of my own, but I want to know if I can make Roo *GENERATE* the web application with my banner from the start (Roo must get this image from somewhere on my local file system, if I knew where, is it possible to just replace it?), rather than me having to go and fiddle with image files in the generated project...

Any help appreciated.
10 years ago
Dear Sirs et Madames,
I am trying to copy and Image file from "C:\Users\Sir Tumaini Kilimba\Desktop\banner-graphic.png" to "C:\Users\Sir Tumaini Kilimba\Desktop\Generic Application\src\main\webapp\images", all via a java application. Can anyone suggest a way of doing this?

Thanks in advance
10 years ago
Ok thanks... so where do I start, how does one create a Java application that sends and receives SMS messages?
11 years ago
Hello Ulf, thanks for the quick response. What are the questions I need to ask of them (the network providers)? Also, is it not possible to create a prototype without having to go through the network provider? Are there no workarounds to that? Because if one uses AT commands, one can get their gsm modem to send or receive messages without involving the service provider (after all, they still get their money as each text message is still charged the standard rate), so in similar fashion, can one not create a prototype application of that sort without going to the service provider. If not, what would I need from the service provider when I go see them, what should I ask from them?

Thanks alot, and sorry for the many questions
11 years ago