I'm playing with Objective-C Distributed Objects and I'm having some problems understanding how memory management works under the system. The example given below illustrates my problem:
Protocol.h
#import <Foundation/Foundation.h>
@protocol DOServer
- (byref id)createTarget;
@end
Server.m
#import <Foundation/Foundation.h>
#import "Protocol.h"
@interface DOTarget : NSObject
@end
@interface DOServer : NSObject < DOServer >
@end
@implementation DOTarget
- (id)init
{
if ((self = [super init]))
{
NSLog(@"Target created");
}
return self;
}
- (void)dealloc
{
NSLog(@"Target destroyed");
[super dealloc];
}
@end
@implementation DOServer
- (byref id)createTarget
{
return [[[DOTarget alloc] init] autorelease];
}
@end
int main()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
DOServer *server = [[DOServer alloc] init];
NSConnection *connection = [[NSConnection new] autorelease];
[connection setRootObject:server];
if ([connection registerName:@"test-server"] == NO)
{
NSLog(@"Failed to vend server object");
}
else
[[NSRunLoop currentRunLoop] run];
[pool drain];
return 0;
}
Client.m
#import <Foundation/Foundation.h>
#import "Protocol.h"
int main()
{
unsigned i = 0;
for (; i < 3; i ++)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
id server = [NSConnection rootProxyForConnectionWithRegisteredName:@"test-server"
host:nil];
[server setProtocolForProxy:@protocol(DOServer)];
NSLog(@"Created target: %@", [server createTarget]);
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]];
[pool drain];
}
return 0;
}
The issue is that any remote objects created by the root proxy are not released when their proxy counterparts in the client go out of scope. According to the documentation:
When an object’s remote proxy is deallocated, a message is sent back to the receiver to notify it that the local object is no longer shared over the connection.
I would therefore expect that as each DOTarget goes out of scope (each time around the loop) it's remote counterpart would be dellocated, since there is no other reference to it being held on the remote side of the connection.
In reality this does not happen: the temporary objects are only deallocate when the client application quits, or more accurately, when the connection is invalidated. I can force the temporary objects on the remote side to be deallocated by explicitly invalidating the NSConnection object I'm using each time around the loop and creating a new one but somehow this just feels wrong.
Is this the correct behaviour from DO? Should all temporary objects live as long as the connection that created them? Are connections therefore to be treated as temporary objects which should be opened and closed with each series of requests against the server?
Any insights would be appreciated.
I'm building a MOSS 2007 site on Windows 2008 R2, 64 bit.
Not wanting to use my machine name or IP in the URL, I made an entry in my hosts file:
127.0.0.1 mydev.com
I can surf to the URL, http://mydev.com, but when I try to log in (Windows Authentication), I am denied.
I am able to successfully log in if I take out the hosts file entry, and surf to http://
Do I need to edit something else for the authentication to work when I want to use a custom URL like mydev.com that is only mapped in the hosts file?
We are trying to shape up an old, 2 tier, Delphi based application. It originally uses database authentication, we'd like to transform the db user accounts to global users, so an OID server could perform the authentication instead of the database.
The Delphi program can no longer log into the database if the account is a global user. I'm trying to understand the login protocol, so far without results.
Similar thing happens with SQLDeveloper, I can't connect as a global user. SQLPlus however works with both kinds of users. We checked the information flow with Wireshark. When the dbserver asks back for a password, the SQLPlus sends it, while the SQLDeveloper doesn't send a password when attempting to connect as a global user.
The client sends the application name too in the login request. Is it possible that we have to store the client app name in the LDAP itself?
Hi all,
We hav an EJB, jws-anotated as a web service. It has a pretty complex pojo-model that generates an equally complex xsd. The pojos contain numerous java.util.Date. These all map to xs:dateTime.
This service is used as "business service" in Oracle(BEA) OSB(AquaLogic). We also have a "proxy service" which we map to the BS with XQuery (the OSB/AquaLogic way). The proxy service's xsd has xs:date for the corresponding fields.
For some reason, Oracle's implementation of XQuery does not support casting from xs:date to xs:dateTime(!).
I could solve this by casting to xs:string and concat:ing with "T00:00:00", however, i would rather try to get JAX-WS to generate an xsd with xs:date instead. Only, I can't find any info on how to do this (anotations?).
Can anyone give me a hint?
Kind regards,
Lars
Recently i have some problems accessing websites. When i try to access it says
This webpage is not available.
I tried accessing the site through FireFox, Internet Explorer and Chrome. I also tried with using a web proxy but still the same problem. This problem is only in my Desktop PC, all the websites works fine in my laptop
Currently i cant access,
yahoo.com
download.com
bing.com
proxy.org
daniweb.com
aol.com
and many forums
I check with the host file but nothing is blocked in that. Can some one please suggest what is wrong??
Thanks
I am working on a proxy server. I am getting data in byte[] which i convert into a string to perform certain operations. Now when i convert this new string back into a byte [] it causes unkonw problems.
So mainly its like i need to know how to correctly convert a byte[] into a string and then back into a byte[] again.
I tried to just convert the byte[] to string and then back to byte[] again (to make sure thats its not my operations that are causing problems).
So its like:
// where reply is a byte[]
String str= new String(reply,0, bytesRead);
streamToClient.write(str.getBytes(), 0, bytesRead);
is not equivalent to
streamToClient.write(reply, 0, bytesRead);
my proxy works fine when i just send the byte[] without any conversion but when i convert it from byte[] to a string and then back to a byte[] its causes problems.
can some one please help? =]
i'm working on a front display for an alfresco filled with pictures.
i'm building my pictures url like this :
http://myHost.com:8080/share/proxy/alfresco-noauth/api/node/content/workspace/SpacesStore/bf0a8b21-b8d9-487d-a529-dee8c49d7c6f/filetitle.jpg?alf_ticket=myTicket
where myHost is the server and myTicket is the ticket generated at this url :
http://myHost.com:8080/alfresco/service/api/login?u=login&pw=password
Picture is displaying correctly with this url, but i want to use phpthumb to resize it, and when i try to use it on my picture, i get an http 500 error on the script and the following log :
PHP Warning: getimagesize(http://myHost.com:8080/share/proxy/alfresco-noauth/api/node/content/workspace/SpacesStore/bf0a8b21-b8d9-487d-a529-dee8c49d7c6f/filetitle.jpg?alf_ticket=myTicket): failed to open stream: HTTP request failed! HTTP/1.1 401 Non-Autorisé
I shouldn't hit the authentification, since my link has a valid ticket (I don't hit authentification when i display normally my picture)
I'm writing a web app, initially meant to be stand-alone--it's essentially a survey with user-management/authentication built on Codeigniter. The company I'm doing this for wants to merge it with their main system so that it acts like a feature, or a sub-app of their website.
What is the best thing for me to do? I think I could do one of two things:
Finish my application, as I had planned to initially, and let them handle the merging.It would probably save me a headache.
Stop where I am in development, and migrate my authentication system to theirs, migrate the payment system to use theirs, and then finish the app.
In your opinion, or experience, what is the best thing to do?
I use asp.net cookie in my application here is my web config :
<authentication mode="Forms">
<forms path="/"
defaultUrl="Default.aspx"
loginUrl="Login.aspx"
name=".ASPXAUTH"
slidingExpiration="true"
timeout="3000"
domain="www.mysite.com"
cookieless="UseDeviceProfile"/>
</authentication>
it works fine but I have a problem, after some days when a user has been working with the site application, suddenly my login control didn't work. I found out it will work after deleting temporary files.
Edit : Please pay attention to domain when User request www.mysite.com every thing is okay but without "www" login doesn't work. in firefox they are working very good. this is IE problem.
How I can solve this ?
My web server is IIS7 running on Windows 2008 Web edition. There are nearly 40 modules when checked pre-installed "Modules". It also having "CgiModule and FastCgiModules". All the websites installed on this server purely runs with ASP.NET technology. Can I remove these two modules to improve performance?
Same way, my application uses "Forms Authentication" only. In such case can I delete "Windows Authentication and WindowsAuthenticationModule"?.
Also please suggest if any other modules can be deleted to improve performance.
So I know that there is a very similar question to this all over the web as well as stack overflow:
http://stackoverflow.com/questions/2539961/error-access-denied-for-user-mysql-server
but my question I think is different. So I have set up a linked server and it works...I have the correct permissions set up for my IP's that I am using. However the problem arises when our user "webuser@correctIP" tries to access it. Therefore, any user using window authentication is allowed to access it and works great...but any that are not using windows authentication are blocked.
However, I have tried all the common solutions such as setting up a strict password, changing security settings in Microsoft SQL Server etc. Nothing is working. Any help is appreciated. Thanks.
FYI: I am using this from Microsoft SQL Server 2008 - mysql (through myphpadmin)
I'm developing silverlight app with WCF Ria service. I'm using MS SQL database and Entity Framework as ORM framework (Database first method). Model with domain service are in separate project - App1.Data. Silverlight and generated model proxy classes are in App1 project.
I want to add property to model entity class EntityClass to get this property on client side.
So I did it that way - added this class to project App1.Data:
public partial class EntityClass
{
[DataMember]
public List<EntityClass2> PropertyName {get; set;}
}
After rebuilding EntityClass proxy on client side doesn't have this new property.
Where is my mistake?
I am trying to emulate a web browser in order to execute JavaScript code and then parse the DOM. The System.Windows.Forms.WebBrowser object does not give me the functionality I need. It let's me set the headers, but you cannot set the proxy or clear cookies. Well you can, but it is not ideal and messes with IE's settings.
I've been extending the WebBrowser control pinvoking native windows functions so far, but it is really one hack on top of another. I can mess with the proxy and also clear cookies and such, but this control has its issues as I mentioned.
I found something called WebKit .NET (http://webkitdotnet.sourceforge.net/), but I don't see support for setting proxies or cookie manipulation.
Can someone recommend a c++/.NET/whatever library to do this:
Basically tell me what I need to do to get an interface to similar this in .NET:
string FetchBrowserParsedHtml(Uri url, WebProxy p, int timeoutSeconds,
byte[] headers, byte[] postdata);
void ClearCookies();
I am not responsible for my actions.
I'm trying to animate a chess piece in a board. First I created a java.util.Timer object that "scheduleAtFixedRate" a TimerTask implemented as a proxy function. So I kept a record of the piece to move (piece-moving-record) and when it's apropriate (when the user move the piece using the mouse) the TimerTask proxy function should be test if the record is not nil and execute the piece-moving function. The piece-moving function just updates the x and y coordinates of the piece, according to a vector pre-calculated. I put a add-watch on the piece-moving-record so when it changes it should repaint the board (canvas). The paint method tests if this piece-moving-record is not nil to paint it.
The problem is that the animation doesn't appear. The piece just jump to the destiny, without the movement between. There is some problem with the animation scheme ou there is a better way to do it?
Hi,
How do I differentiate between multiple cookies set through my site? I am setting two kinds of cookies one to see if the user has visited the site or not and an other one for authentication. How do I differentiate between these two? I get both of them when someone accesses a page after authentication. Do I add extra information to the Cookie Value or is there some other way? I understand the setName() function will change the name (from jsessionid) for every cookie from then on. Am I correct?
Pav
Hello,
I am trying to use Federated authentication on Azure. I found a example of having a local sts outside azure which is used for authentication from a web role hosted in azure. This works perfectly.
My issue is, i dont want to have an application outside azure. Instead, I want to host the local sts website also in azure. So in effect I will have two web roles (1. my actual website, 2. the sts).
I tried the above approach my creating a new webrole and moving the files from my original sts project. But i am getting compilation errors even if I reference the required dlls. I have also set "copy local" to true.
It will be very helpful if somebody can guide me..
Thanks
hi, i have a form with 2 fields
username:
password:
and a submit button.
the user will enter his username and password for a remote website(not my website or my domain. eg. Gmail.com).
i want once he click the submit button.a jQuery script check these login info on gmail.com and return back the result.they are wrong or working logins. and notify the user if it is wrong logins but if it is good working login info the form will submit.
i don't know much jQuery but i am good with php. my search find that in order to do that i need to make cross-domain scripting by using php proxy between my jQuery script and the remote domain.
i found also the simple php proxy. which looks great.but i dont know how to make the jQuery thing that connects all this together.
Hi folks,
I've a problem with JBoss 3.2.6. When I try to launch it, I get this error.
09:19:22,449 ERROR [StatefulSessionContainer] Starting failed jboss.j2ee:jndiName=TypicalBean,service=EJB
java.rmi.ServerException: Could not bind home; nested exception is:
javax.naming.CommunicationException: Network is unreachable [Root exception is java.io.IOException: Network is unreachable]
at org.jboss.proxy.ejb.ProxyFactory.bindProxy(ProxyFactory.java:385)
at org.jboss.proxy.ejb.ProxyFactory.start(ProxyFactory.java:187)
and so on ...
I use Java 1.6, and I can access to the Web, so I can't really figure out why this problem appears ...
Thanks (and sorry for my poor english)
Rob
Hi all! I have encountered a problem in a Flex application.
I have implemented drag and drop support from a List to a Canvas, and I DragManagers doDrag() - with.a proxy-image. In my custom DragDrop event handler, i place a new item on the Canvas. I use the event.localX/localY to position the new item.
It is working ok, but the problem is that I want the "new" image to appear exactly where the proxy-image is when i release the mouse button (x/y -wise).
Can I somehow get the proxys X,Y location. I thought that DragManager would have a reference to it but I can´t find it.
Thanks
/C
How to enable Authentication on whole controller and disable only for certain action methods. I want authentication for all resources. If I write something like that:
[Authorize]
public class HomeController : BaseController
{
//This is public
[UnAuthorized]
public ActionResult Index()
{
ViewData["Message"] = "Welcome to ASP.NET MVC!";
return View();
}
//This is private resource
public ActionResult PrivateResource()
{
return View();
}
}
Then anyone can access this resource. Do you have any ideas how to make it better way?
I have grails app which runs on the spring security plugin. It works with no problem.
I wish I could give the users the way to connect with Facebook and social networking site. So I decided to use Spring Security OAuth plugin. I have configured the plugin.
Now I want user can access both via normal local account and also the OAuth authentication.
More precisely I have a controller like this:
@Secured(['IS_AUTHENTICATED_FULLY'])
def test() {
render "Home page!!!"
}
Now I want this controller to be accessed with OAuth authentication too.
Is that possible to do so?
Using simplexml_load_string() how do I get "ForgotPassword" from the following XML?
<?xml version="1.0" encoding="utf-8"?>
<ForgotPassword>
<version>1.0</version>
<authentication>
<login>username</login>
<apikey>login</apikey>
</authentication>
<parameters>
<emailAddress>[email protected]</emailAddress>
</parameters>
</ForgotPassword>
Hi, I am planning on starting my 1st VSTO project.
What I want to be able to do is:
Download and Upload versions of a MS
Word document to a web service. With
authentication by overriding the save
button
Call a web service to list a bunch of tag that can be inserted into a document. When a user double clicks a tag the selected tag is inserted into the cursor position.
I am pretty sure this is all possible just want some confirmation? Also would like to know how long would it take to make something like this. I think the biggest issue will be authentication and listing exiting files to download then allowing the user to download a .doc and restore previous versions of that file via the web service.
My question is about hosting Django and Wordpress under one domain, but two physical machines (actually, they are VMs but same diff).
Let's say I have a Django webapp at example.com. I'd like to start a Wordpress blog about my webapp, so any blog page rank mojo flows back to my webapp, I'd like the blog address t be example.com/blog. My understanding is blog.example.com would not transfer said page rank mojo.
Because I'm worried about Wordpress security flaws compromising my Django webapp, I want to host Django and Wordpress on two physically separate machines.
Given all that, is it possible using re-write rules or a reverse proxy server to do this? I know the easy way is to make my Wordpress blog a subdomain, but I really don't want to do that.
Has anyone done this in the past, is it stable? If I need a third server to be a dedicated reverse proxy, that's totally fine.
Thanks!