Using GWT + Twitter4j - gwt

I am trying to build a simple gwt project that fetches tweets and displays them.The server passes back the tweets of type twitter4j.Tweet to the client.
Both modules import twitter4j.Tweet.
But when I run I get the following error:
--- ERROR: Line 37: No source code is available for type twitter4j.Tweet; did you forget to inherit a required module?.
I seem to have problems in inheriting twitter4j. All the posts I have seen about inheriting a jar file are not clear about how to do so. I understand I must write an inheritance instruction into gwt.xml file, something like
---
but if I try
---
it does not work. Can anyone please explain?
In a post I found on the Web one person suggested not to inherit it but:
-- Don't put twitter4j to your gwt.xml. Just add it your project class path. and make all functionalities like status updating and all in your serviceImpl. Try
This confuses me even more. I have added the jar file to my project libraries. But it does not work
I suspect I am missing something quite elementary here, but I am totally stuck. Is there something like a GWT path?
Many thanks for any help

Keep in mind that everything in your client package is compiled to JavaScript and executed in the user's browser. Thus, you'll only be able to use twitter4j's classes on the server-side of your application; you'll have to create some sort of light-weight GWT-serializable "proxy object" to pass data back and forth between your client and server tiers.
Since you can't use twitter4j on the client side of your app, you will not need anything in your .gwt.xml file referencing it. Instead, you'll add twitter4j to your classpath and do all your updating on the server side (as mentioned toward the bottom of your question). You do mention that it "does not work," but there's not enough information in your question to try to figure out why.

Related

Is it possible to provide seprate server for each user in oracle 10g?

I am getting error whenever i recompile my workflow package.
to solve this error i have to bounce the server which is used among no of users.
if it is possible to get separate server so i can bounce and test it without disturbing DBA/system admin.
Aha; it seems that you posted two questions for the same problem; this is another one.
As of your problem: Oracle says this:
ORA-06508: PL/SQL: could not find program unit being called: "APPS.ATL_OARR_PCKG" '
in 'PLSQL' API 'ATL_OARR_PCKG.GET_CUSTOM_NOTIF'
Why wouldn't you make sure that all objects, referenced by your package, exist before you compile it? What benefit do you see in having an invalid package? You can't use it anyway, you can't test it, you can't do anything.
Therefore, having yet another server most probably won't fix that problem, because I suspect that missing package (if that's what ATL_OARR_PCKG is) won't automagically appear on the new server.

Google App Engine (GAE) WEB-INF/lib order

Hey guys i'm working on a project with Google App Engine. To get Data from my devices we're using MQTT. The org.eclipse.paho.client.mqttv3.* library starts a Thread with "client.connect()".
After some researches i found that you cant just simply create Threads when working with GAE. Following error is shown:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
So i continued searching and someone told to use following code instead of a "normal" Thread:
Thread monitoringThread = ThreadManager.createThreadForCurrentRequest( new Runnable() {..}
So i decompiled the paho library, looked up where the Thread is created and changed it.
I created a new class exported it as mymqttclient.jar
In eclipse i changed the order of my build at Properties -> Java Build Path -> Order and Export so mymqttclient.jar is loaded before the mqtt-client-0.4.0.jar So that it will use my created function with the monitoringThread.
But how can i change the order of the .jar's in the web-inf/lib ?
Thank you very much for your answers, i couldnt find something useful until now.
Firstly there is no need to decompile any of the Paho code it is all available from here.
Since you can now get the clean source, why not just modify the original class and rebuild the jar file, then you don't need to worry about messing with the Classpath to get your class to load first?

Get object instances for a class

I have an instance file register for a custom MultiDataObject in System FileSystem entry: Loaders/text/custom-mime-type/Factories.
My application creates this objects when I open a project and my LogicalView creates the nodes for files in that project.
I need to get a list of instances for those MultiDataObject type, but I've not found way to achieve this.
I try to get this using Lookups.forPath, but anything returned.
¿Any clue for this issue?
With some reflection magic you can get them from a DataObjectPool - package private class in Data Loaders module (see openide.loaders/src/org/openide/loaders/DataObjectPool.java in NetBeans sources). There is no official API of this kind. Intentionally.
I'd say there is something wrong if you need this information. Perhaps you would get better advice if you had explained better what you want to achieve. Asking at NetBeans forum / mailing list will increase your chances even higher.

NServicebus MessageHandlers in a different Project don't get hit

My problem:
I have web project which implements NServicebus and should listen to messages.
Trying to keep my solution tidy I set up a different project for all my messagehandlers.
I now find that these messagehandlers do not get "hit" with messages.
To my understanding NServicebus scans all dll's in the debug folder of the web project to find any classes implementing IHandleMessages<>.
I referenced the messagehandlers class library project in my webproject and it appears in my debug folder, however it does not seem to get hit.
What does work
In a console sample project the inclusion of a referenced project which contains messagehandlers works as expected.
In my web app it works when I move my
messaghandlers to the web app project itself.
Reading through the website http://docs.particular.net/nservicebus/hosting/nservicebus-host/ I found that there are overloads for the Configure.With() method.
However:
I do not know if I need them. They text only seem to suggest that
this will limit the places where NServicebus looks for the
implementations of the interface.
these overloads do not exist in the Configure.WithWeb method which I'm using.
I can solve my problem by moving all the messagehandlers to my web project, but this does not seem like the best solution.
Am I missing something here?
When using NServiceBus in a web project, use NServiceBus.Configure.WithWeb() instead of NServiceBus.Configure.With().
Also, in order to load message handlers in a web application, you need to include the .LoadMessageHandlers() line after .UnicastBus() as described in Hosting NServiceBus in your own Process. Otherwise any IHandleMessages<T> implementations are not loaded and your web application operates as a send-only endpoint.

How do I get my Objects to work in ASP.NET MVC2

I'm rather new to MVC2 (never been in MCV1) though I'm a WebForms developer for some years now...
in my MCV 2 start project I created a App_Code folder that I would put my Business Classes on it, I also add 2 References to 2 DLLs used for the API I'm about to use.
But I don't get Intellisense on the referenced objects
What am I doing wrong?
alt text http://www.balexandre.com/temp/2010-07-28_1343.png
Is this so much different from the WebForms part?
Added
Even if I put the Object in Models instead App_Code (where I normally put all code in WebForms) I still don't get the normal intelisense, so... it just tells me that something is wrong ... dang! MVC is hard! I probably should do this in WebForms...
alt text http://www.balexandre.com/temp/2010-07-28_1509.png
This has nothing to do with MVC2, and everything to do with you're doing it wrong. I can tell that its a possibility, as you're using App_Code (I mean, who does that?). I'd definitely suggest backing up and reading some MVC tutorials, as it IS much different (although not in the way you're asking about).
I'm not exactly sure WHAT you're doing wrong, however. It might bethat PerceptiveMCAPI is internal to the assembly, it might be because there is a bug in VS, it might be that you haven't imported the correct namespace... it could be a number of different things.
I'd do the following: 1) load the assembly in reflector and make sure you have the namespace and type name and that it is public 2) use the fully qualified name of the type 3) compile, check all errors and 4) restart VS.
If all else fails, Connect.
See the Models directory -- that's where your model classes would go, assuming the class is a view model class. Having said that, it should be able to pick up and provide intellisense for whatever references you add. App_Code isn't really intended for a Web Application project (the type used by MVC) where the code is compiled statically, but rather for a WebSite where the code is compiled dynamically at runtime. It could be the "special" nature of the directory that is causing the problem because it doesn't fit the project type. You might try simply creating a different directory (if Models isn't appropriate) and not use the special App_Code directory for your code. A separate class library project with a project reference in the web application would be another alternative and is the one I usually use for non-viewmodel/controller code.