Question about OSGi for embedded - java-me

I am going to work on the OSGi-based Embedded/Mobile applications. I have some confused questions need to be clarified.
(1) Can Equinox run on J2ME environment or not?
(2) How to start the Equinox OSGi container under the pure J2ME environment (not JDK and JRE installed)?
(3) Can I use some external jars / Third party's jars (which is based on JRE classes) for the embedded application?
Thank you!

Java ME is something of an "embedded" environment, meaning amongst other things that there is generally not as much memory to run in or storage space. At one time there were application size limits.
What this means is that instead of trying to dump big, fat, J2SE jars into a device with limited capabilities, perhaps you should try rethinking what you are trying to accomplish.
Also consider that the version of Java that mobile phones run is fairly limited, so many 'regular' Java applications and libraries will not work there.
You can include jars in your applications, by taking their contents and dumping them in the jar you create.
In other words, you have to think differently about Java ME - it's not the bloated world that most Java stuff inhabits.

I don't know much about Equinox OSGi but, as I found from it's web page, it's looks like support OSGi MEG. Then it could run on mobile devices with Java ME CDC runtime not CLDC.
OSGi should depends on features of CDC VM as like dynamic class loading, refelection or else.
Please find phoneME CDC project (phoneME advanced) from here.

Related

Recommendation on building web services on Linux with minimal dependencies

I need a recommendation for a framework/library for building web services on a Linux system. I have the following requirements:
It should have minimal dependencies, e.g. preferably not require any VM like Java or Mono.
My service implementation should have access to the native system APIs, preferably it should be possible to call C APIs directly.
If possible, the solution should not depend on a large web server installation. As I understand, Axis/C++ would require an Apache server, right? Is there anything that allows for writing some kind of "self-hosted" web service like in .NET (ServiceHost) on Linux? I would really like something that works as a standalone daemon in the end.
The resulting services should be standard-compliant as I need to make cross-platform calls. Most importantly, I need WS-Security.
The solution must be Open Source, the actual licence is less important.
If you have any suggestions, please post (web links would be nice ;-))
Thanks in advance,
Christoph
What about Twisted? http://twistedmatrix.com/trac/

Is using Node.js or Ringojs safe for live websites?

As stated in the title, I would like to know if it's safe to develop a website using one of the actuals "omg" platforms that are Node.js and Ringo.js at their actual version.
Also, I would like to know if they support cookies/sessions and how do they deals with multi-fields post (fieldname[] in PHP).
Thank you
--Edit--
Thanks for all the links guys.
What can you tell me about Ringojs ?
Since I haven't figured which platform to start playing with. I must admit that the fact it can use Java seamlessly really impress me. The only available XSLT 2.0 library is in Java. I could use it as a templating system.
Is there anyone who had the chance to play with Ringojs?
From my experience using both, Ringo is more stable and "safer" for production use but you can comfortably deploy both. In addition to the ability to wrap existing Java libraries that you mention, you also get the benefit of being able to run it in an existing webapp container which manages the lifecycle of the application for you and ensures its availability.
That being said, it doesn't have to be an either or decision. By using my common-node package and assuming you don't use any Java libraries, it's perfectly feasible to maintain a project that runs on both without any changes to the code.
I've also included benchmarks that test the performance of Node.js vs. RingoJS the results of which you can find in the common-node/README.md. To summarize: RingoJS has slightly lower throughput than Node.js, but much lower variance in response times while using six times the RAM with default Java settings. The latter can be tweaked and brought down to as little as twice the memory usage of Node with e.g. my ringo-sunserver but at the expense of decreased performance.
Node.js is stable, so yes it's safe to use. Node.js is capable of handling cookies, sessions, and multiple fields but are not as easy to manage. Web frameworks solve this problem.
I recommend Express.js, it's an open-source web framework for Node.js which handles all of this and more.
You can download it here:
https://github.com/visionmedia/express
I hope this helped!
Examples of some of the bigger sites running Node.js
https://www.learnboost.com/
http://ge.tt/
https://gomockingbird.com/
https://secured.milewise.com/
http://voxer.com/
https://www.yammer.com/
http://cloud9ide.com/
http://beta.etherpad.org/
http://loggly.com/
http://wordsquared.com/
Yes. It is. https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node and https://github.com/joyent/node/wiki/modules
cookies/sessions/forms etc http://expressjs.com/ makes it easier
Ringojs is a framework developed by Hannes Wallnöver and uses rhino as it's scripting framework. There are webframeworks, templating-engines, orm-packages and many many more things already available. Have a look at the tutorial featuring a good subset of packages you may use for a simple web-application. It's not too long and straightforward.
Even thought some of those packages used within the tutorial (e.g. ringo-sqlstore]) are marked as 0.8 and come with the hint "consider this being beta" they are already very stable and bugs - if you find one - get fixed or commented on very fast.
And the power of uncountable java-libraries out there is at your fingertips - so if you already have java-knowledge this knowledge isn't wasted. Rhino - the scripting-engine - even enables you to implement interfaces and extend classes. It is possible a little more advanced but i've done it and i know of packages taking advantage of such features (like ringo-ftpserver which is a wrapper around Apache FtpServer written in java)
Another pro for me is - because ringojs is based on java - it works fairly well with multithreading with ringo/worker for example.

Apex Data Loader in Linux environment?

According to a requirement, we have to do data loading to Salesforce.com in Linux environment. In Windows, the Apex data loader works fine for data loading.
Apex data loader is written in Java so it should work in Linux. How can we run the Apex data loader in Linux or is there any alternative application for data loading for linux?
I was under impression that core of Data Loader is a JAR file so if your server is running Java you could fairly easily discard the GUI of application written for Windows?
Please have a look at Data Loader User Guide, especially chapters about running it from command line and in batch mode. In worst case you could even roll out your own program that will use WebServices API exactly like Data Loader does (with reuse of the JAR or written from scratch).
Another option would be to use "bulk API", designed for mass inserts. The guide for this is extremely technical and contains tons of useful info (including code of sample Java app).
There's "Excel connector" and build of "LexiLoader" for MacOS but I don't think this helps a lot in your case.
Last but not least - please consider the Salesforce partners, their AppExchange applications etc. I don't want to do marketing here but on my past project we were pleased with tool from "Relational Junction" (it was working on Unix server, easy to configure, connected with Oracle database, allowed us to pretty much do a proper Extract-Transform-Load proces to and from Salesforce).
Good luck!
Here are a couple of posts that might help others not using the Apex Data Loader in the standard way:
http://force201.wordpress.com/2011/01/20/running-the-apex-data-loader-on-a-mac/
http://force201.wordpress.com/2010/10/15/scripting-the-apex-data-loader-via-ant/
One is about running on the Mac and the other is about running using Ant.
www.dataloader.io is the way to go now; it's web-based an unbiased to your OS.
Well, dataloader is a Java app so it is quite biased do any OS that can has a Java runtime. I have been working on an Ubuntu system using Gui.
11 years later, there's still no official Linux build, but everything you need is there. That's why I've created a small Github project, that automatically builds the latest Dataloaders versions for Debian/Ubuntu (deb files) from the original sources.
You can find it here: https://github.com/SoftCreatR/dataloader-for-linux

Writing a SOAP service on Linux - tools, help needed

I need to write a SOAP service for Linux (CentOS).
I need to do this using Lazarus/FreePascal. The service needs to be a binary (daemon) that runs in the background.
Questions:
1. Is this possible (as a standalone executable)?
2. If not, what are the alternatives?
3. How do I start?
4. What additional tools/libraries do I need?
This is possible with wst and either synapse or indy. wst is alsready included in your Freepascal download. There are some samples included as well, have a look at them.
I have created several soap services with wst + freepascal. You can choose to have them use their own webserver (so they just listen on a certain port, allows for simple debugging) or create an cgi module that you can use in Apache or IIS. You can also create a windows service or linux daemon, all by switching some parameters or including some other files.
It is not easy if you do it for the first time, but certainly possible.
I can answer some of your points since I'm doing it myself:
Using Lazarus and installing the LazDaemon package you can do daemons/services that compile and run stand alone on both Windows(Service) and Linux(Daemon). Daemons and Services
N/A
You have examples under the [fpc-source-dir]/packages/fcl-base/example/daemon.pp and under [lazarus-dir]/examples/cleandir/*
You will need some kind of SOAP framework that I'm not versed in.
Hope it helps.
This looks promising, at least as a start.
SOAP is a language neutral specification so in theory you could code in any language. But for your purposes if you can't find a library in pascal that does the grunt work you would be better off using any other language that does. Unless you are specifically looking for a long detour down the rabbit hole of WSDL and such, don't go there.
Is Pascal really a requirement??
Otherwise, you could write a SOAP service in Java, then your service would be platform agnostic.
The only requirement would be a JRE, and JRE are available for any platform, so it would run perfectly on all Linux flavors, WIndows, Mac OsS, Solaris, etc
There are also plenty of frameworks for doing SOAP in Java.
Pascal would also be able to run on Linux and Windows with minor adjustments, but I have no knowledge of existing good SOAP frameworks for Pascal.
I would just use Indy, and whatever Delphi soap lib a google search yielded. I would be surprised if there weren't a dozen.

The hunt for the J2ME-friendly IoC container is on!

I'm in the beginning phases of a Blackberry/J2ME project -- and along with other limitations that come with this wonderful platform, the lack of support for reflection and 1.3 language level mean that the vast majority of existing IoC containers are unusable. (Google has Guice for Android with no AOP, but even that requires support for annotations).
So the space of IoC containers on J2ME is pretty limited. The one framework that has caught my attention is called Signal Framework, and it looks pretty promising. It tries to stay conceptually close to Spring Framework's IoC, implementing a small subset of its functionality, and does so without relying on bytecode-modification or causing runtime xml parsing. Instead, it processes configuration XMLs at build-time to generate java code which implements this IoC functionality.
Generally speaking, code generation at build time seems like a very wise approach for mobile applications -- and if my app has to do less XML parsing on user's device, that's great too!
So, what have your experiences been with implementing IoC on J2ME/CLDC, and how were you able to extinguish that bitter taste in your mouth?
We used Spring ME at TomTom. It worked out pretty well.
In J2ME you need to reduce the number of classes you use as much as possible to reduce the size of jar files. This leads to many design compromises not least of which is flexibility.
It is not easy to adjust to J2ME development when you have to throw must of what you hae learnt (and come to value highly) about OO out the window. The truth is if you want apps that can run on a large range of phones you need to be very sensitive to the constraints of the devices.
As such I do not think an IoC framework will match many people's needs for J2ME development.
You might be interested in checking out FallME. Even though I haven't used it personally, it seems like a no non-sense framework built specifically for the J2ME platform.
I came across Spring ME during a Dutch JUG conference (have no experience with it whatsoever).
Signal Framework it is.
Update: unfortunately, Signal is very undercooked right now, so I'm going with Israfil IOC with custom additions.

Resources