Search Results

Search found 28345 results on 1134 pages for 'custom event'.

Page 109/1134 | < Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >

  • How to make Net::Msmnr run?

    - by codeholic
    There's Net::Msmgr module on CPAN. It's written clean and the code looks trustworthy at the first glance. However this module seems to be beta and there is little documentation and no tests :-/ Has anyone used this module in production? I haven't managed to make it run by now, because it requires all event loop processing to be done in the application and as I've already said there is little documentation and no working examples to study. That's where I've gone so far: #!/usr/bin/perl use strict; use warnings; use Event; use Net::Msmgr::Object; use Net::Msmgr::Session; use Net::Msmgr::User; use constant DEBUG => 511; use constant EVENT_TIMEOUT => 5; # seconds my ($username, $password) = qw/[email protected] my.password/; my $buddy = '[email protected]'; my $user = Net::Msmgr::User->new(user => $username, password => $password); my $session = Net::Msmgr::Session->new; $session->debug(DEBUG); $session->login_handler(\&login_handler); $session->user($user); my $conv; sub login_handler { my $self = shift; print "LOGIN\n"; $self->ui_state_nln; $conv = $session->ui_new_conversation; $conv->invite($buddy); } our %watcher; sub ConnectHandler { my ($connection) = @_; warn "CONNECT\n"; my $socket = $connection->socket; $watcher{$connection} = Event->io(fd => $socket, cb => [ $connection, '_recv_message' ], poll => 're', desc => 'recv_watcher', repeat => 1); } sub DisconnectHandler { my $connection = shift; print "DISCONNECT\n"; $watcher{$connection}->cancel; } $session->connect_handler(\&ConnectHandler); $session->disconnect_handler(\&DisconnectHandler); $session->Login; Event::loop(); That's what it outputs: Dispatch Server connecting to: messenger.hotmail.com:1863 Dispatch Server connected CONNECT Dispatch Server >>>VER 1 MSNP2 CVR0 --> VER 1 MSNP2 CVR0 Dispatch Server >>>USR 2 MD5 I [email protected] --> USR 2 MD5 I [email protected] Dispatch Server <<<VER 1 CVR0 <-- VER 1 CVR0 And that's all, here it hangs. The handler on login is not being triggered. What am I doing wrong?

    Read the article

  • Why does Perl's Net::Msmgr hang when I try to authenticate?

    - by codeholic
    There's Net::Msmgr module on CPAN. It's written clean and the code looks trustworthy at the first glance. However this module seems to be beta and there is little documentation and no tests :-/ Has anyone used this module in production? I haven't managed to make it run by now, because it requires all event loop processing to be done in the application and as I've already said there is little documentation and no working examples to study. That's where I've gone so far: #!/usr/bin/perl use strict; use warnings; use Event; use Net::Msmgr::Object; use Net::Msmgr::Session; use Net::Msmgr::User; use constant DEBUG => 511; use constant EVENT_TIMEOUT => 5; # seconds my ($username, $password) = qw/[email protected] my.password/; my $buddy = '[email protected]'; my $user = Net::Msmgr::User->new(user => $username, password => $password); my $session = Net::Msmgr::Session->new; $session->debug(DEBUG); $session->login_handler(\&login_handler); $session->user($user); my $conv; sub login_handler { my $self = shift; print "LOGIN\n"; $self->ui_state_nln; $conv = $session->ui_new_conversation; $conv->invite($buddy); } our %watcher; sub ConnectHandler { my ($connection) = @_; warn "CONNECT\n"; my $socket = $connection->socket; $watcher{$connection} = Event->io(fd => $socket, cb => [ $connection, '_recv_message' ], poll => 're', desc => 'recv_watcher', repeat => 1); } sub DisconnectHandler { my $connection = shift; print "DISCONNECT\n"; $watcher{$connection}->cancel; } $session->connect_handler(\&ConnectHandler); $session->disconnect_handler(\&DisconnectHandler); $session->Login; Event::loop(); That's what it outputs: Dispatch Server connecting to: messenger.hotmail.com:1863 Dispatch Server connected CONNECT Dispatch Server >>>VER 1 MSNP2 CVR0 --> VER 1 MSNP2 CVR0 Dispatch Server >>>USR 2 MD5 I [email protected] --> USR 2 MD5 I [email protected] Dispatch Server <<<VER 1 CVR0 <-- VER 1 CVR0 And that's all, here it hangs. The handler on login is not being triggered. What am I doing wrong?

    Read the article

  • Log4j: Events appear in the wrong logfile

    - by Markus
    Hi there! To be able to log and trace some events I've added a LoggingHandler class to my java project. Inside this class I'm using two different log4j logger instances - one for logging an event and one for tracing an event into different files. The initialization block of the class looks like this: public void initialize() { System.out.print("starting logging server ..."); // create logger instances logLogger = Logger.getLogger("log"); traceLogger = Logger.getLogger("trace"); // create pattern layout String conversionPattern = "%c{2} %d{ABSOLUTE} %r %p %m%n"; try { patternLayout = new PatternLayout(); patternLayout.setConversionPattern(conversionPattern); } catch (Exception e) { System.out.println("error: could not create logger layout pattern"); System.out.println(e); System.exit(1); } // add pattern to file appender try { logFileAppender = new FileAppender(patternLayout, logFilename, false); traceFileAppender = new FileAppender(patternLayout, traceFilename, false); } catch (IOException e) { System.out.println("error: could not add logger layout pattern to corresponding appender"); System.out.println(e); System.exit(1); } // add appenders to loggers logLogger.addAppender(logFileAppender); traceLogger.addAppender(traceFileAppender); // set logger level logLogger.setLevel(Level.INFO); traceLogger.setLevel(Level.INFO); // start logging server loggingServer = new LoggingServer(logLogger, traceLogger, serverPort, this); loggingServer.start(); System.out.println(" done"); } To make sure that only only thread is using the functionality of a logger instance at the same time each logging / tracing method calls the logging method .info() inside a synchronized-block. One example looks like this: public void logMessage(String message) { synchronized (logLogger) { if (logLogger.isInfoEnabled() && logFileAppender != null) { logLogger.info(instanceName + ": " + message); } } } If I look at the log files, I see that sometimes a event appears in the wrong file. One example: trace 10:41:30,773 11080 INFO masterControl(192.168.2.21): string broadcast message was pushed from 1267093 to vehicle 1055293 (slaveControl 1) trace 10:41:30,784 11091 INFO masterControl(192.168.2.21): string broadcast message was pushed from 1156513 to vehicle 1105792 (slaveControl 1) trace 10:41:30,796 11103 INFO masterControl(192.168.2.21): string broadcast message was pushed from 1104306 to vehicle 1055293 (slaveControl 1) trace 10:41:30,808 11115 INFO masterControl(192.168.2.21): vehicle 1327879 was pushed to slave control 1 10:41:30,808 11115 INFO masterControl(192.168.2.21): string broadcast message was pushed from 1101572 to vehicle 106741 (slaveControl 1) trace 10:41:30,820 11127 INFO masterControl(192.168.2.21): string broadcast message was pushed from 1055293 to vehicle 1104306 (slaveControl 1) I think that the problem occures everytime two event happen at the same time (here: 10:41:30,808). Does anybody has an idea how to solve my problem? I already tried to add a sleep() after the method call, but that doesn't helped ... BR, Markus Edit: logtrace 11:16:07,75511:16:07,755 1129711297 INFOINFO masterControl(192.168.2.21): string broadcast message was pushed from 1291400 to vehicle 1138272 (slaveControl 1)masterControl(192.168.2.21): vehicle 1333770 was added to slave control 1 or log 11:16:08,562 12104 INFO 11:16:08,562 masterControl(192.168.2.21): string broadcast message was pushed from 117772 to vehicle 1217744 (slaveControl 1) 12104 INFO masterControl(192.168.2.21): vehicle 1169775 was pushed to slave control 1 Edit 2: It seems like the problem only occurs if logging methods are called from inside a RMI thread (my client / server exchange information using RMI connections). ... Edit 3: I solved the problem by myself: It seems like log4j is NOT completely thread-save. After synchronizing all log / trace methods using a separate object everything is working fine. Maybe the lib is writing the messages to a thread-unsafe buffer before writing them to file?

    Read the article

  • dynamic multiple instance of swfupload (firefox vs IE)

    - by jean27
    We have this dynamic uploader which creates a new instance of swfupload. I'm a little bit confused with the outputs produced by firefox and ie. Firefox have the same output as chrome, safari and opera. Whenever I clicked a button for adding a new instance, the previous instances of swfupload in firefox refresh while IE don't. I have this debug information: For Firefox: SWF DEBUG OUTPUT IN FIREFOX ---SWFUpload Instance Info--- Version: 2.2.0 2009-03-25 Movie Name: SWFUpload_0 Settings: upload_url: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== flash_url: /content/swfupload.swf?preventswfcaching=1272512466022 use_query_string: false requeue_on_error: false http_success: assume_success_timeout: 0 file_post_name: Filedata post_params: [object Object] file_types: .jpg;.gif;.png;.bmp file_types_description: Image Files file_size_limit: 1MB file_upload_limit: 1 file_queue_limit: 1 debug: true prevent_swf_caching: true button_placeholder_id: file-1_swf button_placeholder: Not Set button_image_url: /content/images/blankButton.png button_width: 109 button_height: 22 button_text: button_text_style: color: #000000; font-size: 16pt; button_text_top_padding: 1 button_text_left_padding: 30 button_action: -110 button_disabled: false custom_settings: [object Object] Event Handlers: swfupload_loaded_handler assigned: true file_dialog_start_handler assigned: true file_queued_handler assigned: true file_queue_error_handler assigned: true upload_start_handler assigned: true upload_progress_handler assigned: true upload_error_handler assigned: true upload_success_handler assigned: true upload_complete_handler assigned: true debug_handler assigned: true SWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ---- SWF DEBUG: Build Number: SWFUPLOAD 2.2.0 SWF DEBUG: movieName: SWFUpload_0 SWF DEBUG: Upload URL: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== SWF DEBUG: File Types String: .jpg;.gif;.png;.bmp SWF DEBUG: Parsed File Types: jpg,gif,png,bmp SWF DEBUG: HTTP Success: 0 SWF DEBUG: File Types Description: Image Files (.jpg;.gif;.png;.bmp) SWF DEBUG: File Size Limit: 1048576 bytes SWF DEBUG: File Upload Limit: 1 SWF DEBUG: File Queue Limit: 1 SWF DEBUG: Post Params: SWF DEBUG: ----- END SWF DEBUG OUTPUT ---- SWF DEBUG: SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: .jpg;.gif;.png;.bmpSWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1---SWFUpload Instance Info--- Version: 2.2.0 2009-03-25 Movie Name: SWFUpload_1 Settings: upload_url: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== flash_url: /content/swfupload.swf?preventswfcaching=1272512476357 use_query_string: false requeue_on_error: false http_success: assume_success_timeout: 0 file_post_name: Filedata post_params: [object Object] file_types: .jpg;.gif;.png;.bmp file_types_description: Image Files file_size_limit: 1MB file_upload_limit: 1 file_queue_limit: 1 debug: true prevent_swf_caching: true button_placeholder_id: file-2_swf button_placeholder: Not Set button_image_url: /content/images/blankButton.png button_width: 109 button_height: 22 button_text: button_text_style: color: #000000; font-size: 16pt; button_text_top_padding: 1 button_text_left_padding: 30 button_action: -110 button_disabled: false custom_settings: [object Object] Event Handlers: swfupload_loaded_handler assigned: true file_dialog_start_handler assigned: true file_queued_handler assigned: true file_queue_error_handler assigned: true upload_start_handler assigned: true upload_progress_handler assigned: true upload_error_handler assigned: true upload_success_handler assigned: true upload_complete_handler assigned: true debug_handler assigned: true SWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ---- SWF DEBUG: Build Number: SWFUPLOAD 2.2.0 SWF DEBUG: movieName: SWFUpload_1 SWF DEBUG: Upload URL: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== SWF DEBUG: File Types String: .jpg;.gif;.png;.bmp SWF DEBUG: Parsed File Types: jpg,gif,png,bmp SWF DEBUG: HTTP Success: 0 SWF DEBUG: File Types Description: Image Files (.jpg;.gif;.png;.bmp) SWF DEBUG: File Size Limit: 1048576 bytes SWF DEBUG: File Upload Limit: 1 SWF DEBUG: File Queue Limit: 1 SWF DEBUG: Post Params: SWF DEBUG: ----- END SWF DEBUG OUTPUT ---- SWF DEBUG: SWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ---- SWF DEBUG: Build Number: SWFUPLOAD 2.2.0 SWF DEBUG: movieName: SWFUpload_0 SWF DEBUG: Upload URL: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== SWF DEBUG: File Types String: .jpg;.gif;.png;.bmp SWF DEBUG: Parsed File Types: jpg,gif,png,bmp SWF DEBUG: HTTP Success: 0 SWF DEBUG: File Types Description: Image Files (.jpg;.gif;.png;.bmp) SWF DEBUG: File Size Limit: 1048576 bytes SWF DEBUG: File Upload Limit: 1 SWF DEBUG: File Queue Limit: 1 SWF DEBUG: Post Params: SWF DEBUG: ----- END SWF DEBUG OUTPUT ---- SWF DEBUG: SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: .jpg;.gif;.png;.bmpSWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...SWF DEBUG: Event: fileQueued : File ID: SWFUpload_1_0SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1SWF DEBUG: StartUpload: First file in queueSWF DEBUG: StartUpload(): No files found in the queue.SWF DEBUG: StartUpload: First file in queueSWF DEBUG: Event: uploadStart : File ID: SWFUpload_1_0SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== for File ID: SWFUpload_1_0SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_1_0SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_1_0. Bytes: 30218. Total: 30218SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_1_0 Response Received: true Data: 65-AddClassification.pngSWF DEBUG: Event: uploadComplete : Upload cycle complete. For IE: SWF DEBUG OUTPUT IN IE ---SWFUpload Instance Info--- Version: 2.2.0 2009-03-25 Movie Name: SWFUpload_0 Settings: upload_url: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== flash_url: /content/swfupload.swf?preventswfcaching=1272512200531 use_query_string: false requeue_on_error: false http_success: assume_success_timeout: 0 file_post_name: Filedata post_params: [object Object] file_types: .jpg;.gif;.png;.bmp file_types_description: Image Files file_size_limit: 1MB file_upload_limit: 1 file_queue_limit: 1 debug: true prevent_swf_caching: true button_placeholder_id: file-1_swf button_placeholder: Not Set button_image_url: /content/images/blankButton.png button_width: 109 button_height: 22 button_text: Browse... button_text_style: color: #000000; font-size: 16pt; button_text_top_padding: 1 button_text_left_padding: 30 button_action: -110 button_disabled: false custom_settings: [object Object] Event Handlers: swfupload_loaded_handler assigned: true file_dialog_start_handler assigned: true file_queued_handler assigned: true file_queue_error_handler assigned: true upload_start_handler assigned: true upload_progress_handler assigned: true upload_error_handler assigned: true upload_success_handler assigned: true upload_complete_handler assigned: true debug_handler assigned: true SWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ---- SWF DEBUG: Build Number: SWFUPLOAD 2.2.0 SWF DEBUG: movieName: SWFUpload_0 SWF DEBUG: Upload URL: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== SWF DEBUG: File Types String: .jpg;.gif;.png;.bmp SWF DEBUG: Parsed File Types: jpg,gif,png,bmp SWF DEBUG: HTTP Success: 0 SWF DEBUG: File Types Description: Image Files (.jpg;.gif;.png;.bmp) SWF DEBUG: File Size Limit: 1048576 bytes SWF DEBUG: File Upload Limit: 1 SWF DEBUG: File Queue Limit: 1 SWF DEBUG: Post Params: SWF DEBUG: ----- END SWF DEBUG OUTPUT ---- SWF DEBUG: Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: .jpg;.gif;.png;.bmpSWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1---SWFUpload Instance Info--- Version: 2.2.0 2009-03-25 Movie Name: SWFUpload_1 Settings: upload_url: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== flash_url: /content/swfupload.swf?preventswfcaching=1272512222093 use_query_string: false requeue_on_error: false http_success: assume_success_timeout: 0 file_post_name: Filedata post_params: [object Object] file_types: .jpg;.gif;.png;.bmp file_types_description: Image Files file_size_limit: 1MB file_upload_limit: 1 file_queue_limit: 1 debug: true prevent_swf_caching: true button_placeholder_id: file-2_swf button_placeholder: Not Set button_image_url: /content/images/blankButton.png button_width: 109 button_height: 22 button_text: Browse... button_text_style: color: #000000; font-size: 16pt; button_text_top_padding: 1 button_text_left_padding: 30 button_action: -110 button_disabled: false custom_settings: [object Object] Event Handlers: swfupload_loaded_handler assigned: true file_dialog_start_handler assigned: true file_queued_handler assigned: true file_queue_error_handler assigned: true upload_start_handler assigned: true upload_progress_handler assigned: true upload_error_handler assigned: true upload_success_handler assigned: true upload_complete_handler assigned: true debug_handler assigned: true SWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ---- SWF DEBUG: Build Number: SWFUPLOAD 2.2.0 SWF DEBUG: movieName: SWFUpload_1 SWF DEBUG: Upload URL: /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== SWF DEBUG: File Types String: .jpg;.gif;.png;.bmp SWF DEBUG: Parsed File Types: jpg,gif,png,bmp SWF DEBUG: HTTP Success: 0 SWF DEBUG: File Types Description: Image Files (.jpg;.gif;.png;.bmp) SWF DEBUG: File Size Limit: 1048576 bytes SWF DEBUG: File Upload Limit: 1 SWF DEBUG: File Queue Limit: 1 SWF DEBUG: Post Params: SWF DEBUG: ----- END SWF DEBUG OUTPUT ---- SWF DEBUG: Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)SWF DEBUG: ExternalInterface reinitializedSWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: .jpg;.gif;.png;.bmpSWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...SWF DEBUG: Event: fileQueued : File ID: SWFUpload_1_0SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1SWF DEBUG: StartUpload: First file in queueSWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0SWF DEBUG: StartUpload: First file in queueSWF DEBUG: Event: uploadStart : File ID: SWFUpload_1_0SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== for File ID: SWFUpload_0_0SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /86707/listing/asynchronousuploadphoto/87085/15/E1ptdReNMwcU/cUkx4p689ChPRZYMKkLZQ== for File ID: SWFUpload_1_0SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 29151. Total: 29151SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_1_0SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_1_0. Bytes: Total: 30218SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: 62-Greenwich_-_Branches.pngSWF DEBUG: Event: uploadComplete : Upload cycle complete.

    Read the article

  • Custom Glassfish Security Realm does not work (unable to find LoginModule)

    - by ifischer
    I'm trying to get a Custom Security Realm in Glassfish working (i tried 3.0.1 final and 3.1 B33). I read nearly all tutorials about this, but it doesn not work on my System. I'm getting the error Login failed: javax.security.auth.login.LoginException: unable to find LoginModule class: de.company.security.utility.CustomLoginModule when trying to login. Here is what i did: I created a little Maven project, which contains the needed Realm class, CustomRealm, and the corresponding LoginModule, CustomLoginModule. My pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany</groupId> <artifactId>CustomJDBCRealm</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>Custom JDBCRealm</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.glassfish.security</groupId> <artifactId>security</artifactId> <version>3.1-b33</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <optimise>true</optimise> <debug>true</debug> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build> </project> My Custom Realm class: package de.company.security.utility; import com.sun.appserv.security.AppservRealm; import com.sun.enterprise.security.auth.realm.BadRealmException; import com.sun.enterprise.security.auth.realm.InvalidOperationException; import com.sun.enterprise.security.auth.realm.NoSuchRealmException; import com.sun.enterprise.security.auth.realm.NoSuchUserException; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; /** * * @author ifischer */ public class CustomRealm extends AppservRealm { Vector<String> groups = new Vector<String>(); private String jaasCtxName; private String startWith; @Override public void init(Properties properties) throws BadRealmException, NoSuchRealmException { jaasCtxName = properties.getProperty("jaas-context", "customRealm"); startWith = properties.getProperty("startWith", "z"); groups.add("dummy"); } @Override public String getAuthType() { return "Custom Realm"; } public String[] authenticate(String username, char[] password) { // if (isValidLogin(username, password)) return (String[]) groups.toArray(); } @Override public Enumeration getGroupNames(String username) throws InvalidOperationException, NoSuchUserException { return groups.elements(); } @Override public String getJAASContext() { return jaasCtxName; } public String getStartWith() { return startWith; } } My LoginModule class: /* * Copyright (c) 2010 ProfitBricks GmbH. All Rights Reserved. */ package de.company.security.utility; import com.sun.appserv.security.AppservPasswordLoginModule; import com.sun.enterprise.security.auth.login.common.LoginException; import java.util.Set; import org.glassfish.security.common.PrincipalImpl; /** * * @author ifischer */ public class CustomLoginModule extends AppservPasswordLoginModule { @Override protected void authenticateUser() throws LoginException { _logger.info("CustomRealm : authenticateUser for " + _username); final CustomRealm realm = (CustomRealm)_currentRealm; if ( (_username == null) || (_username.length() == 0) || !_username.startsWith(realm.getStartWith())) throw new LoginException("Invalid credentials"); String[] grpList = realm.authenticate(_username, getPasswordChar()); if (grpList == null) { throw new LoginException("User not in groups"); } _logger.info("CustomRealm : authenticateUser for " + _username); Set principals = _subject.getPrincipals(); principals.add(new PrincipalImpl(_username)); this.commitUserAuthentication(grpList); } } I compiled this Maven project and copyied the resulting JAR-file to the Glassfish/lib directory. Then i added the Security Realm "customRealm" to my Glassfish with asadmin: asadmin create-auth-realm --classname de.company.security.utility.CustomRealm --property jaas-context=customRealm:startWith=a customRealm I even referenced the LoginModule class for the JAAS context of my Custom Realm, therefore i inserted this into the login.conf of my domain: customRealm { de.company.security.utility.CustomLoginModule required; }; Although this LoginModule SHOULD BE on the Glassfish classpath, as it's classfiled is packaged in the JAR that i put into the Glassfish/lib-dir, it cannot be found when i try to login. For login, i build a really simple JSF-project, which calls the HttpServletRequest-login-method of Servlet 3.0. When trying to login i'm getting the following Exception: 2010-12-24T14:41:31.613+0100|WARNING|glassfish3.0.1| javax.enterprise.system.container.web.com.sun.web.security|_ThreadID=25; _ThreadName=Thread-1;|Web login failed: Login failed: javax.security.auth.login.LoginException: unable to find LoginModule class: de.company.security.utility.CustomLoginModule Anybody got an idea what i can do that Glassfish loads the LoginModule-class?

    Read the article

  • WiX Action Sequence

    - by Damian Vogel
    I was looking for list of actions and their sequence when running a WiX setup. Somehow the official website doesn't seem to provide any information. The basic problem is that I want to schedule my custom actions correctly. Typically I need to register a DLL with regsvr32.exe, and this can only be done once the files are copied to the harddrive. However the custom action <Custom Action="RegisterShellExt" After="InstallFiles"> failed with the error message "file not found". What I've done then is analizing the log of my MSI with WiX Edit, and I've found that the Action InstallFiles exists more than once. And effectively the files are written only the second time it appears. So I changed my custom action to the following : <Custom Action="RegisterShellExt" Before="InstallFinalize"> Here is the sequence I've extracted from the logs of my MSI: Action start 15:16:49: INSTALL. Action start 15:16:49: PrepareDlg. Action start 15:16:49: AppSearch. Action start 15:16:49: LaunchConditions. Action start 15:16:49: ValidateProductID. Action start 15:16:49: DIRCA_NEWRETARGETABLEPROPERTY1.5D429292039C46FCA3253E37B4DA262A. Action start 15:16:50: CostInitialize. Action start 15:16:50: FileCost. Action start 15:16:50: CostFinalize. Action start 15:16:50: WelcomeDlg. Action 15:16:51: LicenseAgreementDlg. Dialog created Action 15:16:53: CustomizeDlg. Dialog created Action 15:16:55: VerifyReadyDlg. Dialog created Action start 15:16:56: ProgressDlg. Action start 15:16:56: ExecuteAction. Action start 15:16:58: INSTALL. Action start 15:16:58: AppSearch. Action start 15:16:58: LaunchConditions. Action start 15:16:58: ValidateProductID. Action start 15:16:58: CostInitialize. Action start 15:16:59: FileCost. Action start 15:16:59: CostFinalize. Action start 15:16:59: InstallValidate. Action start 15:17:00: InstallInitialize. Action start 15:17:08: ProcessComponents. Action 15:17:09: GenerateScript. Generating script operations for action: Action ended 15:17:09: ProcessComponents. Return value 1. Action start 15:17:09: UnpublishFeatures. Action start 15:17:09: RemoveShortcuts. Action start 15:17:09: RemoveFiles. Action start 15:17:09: InstallFiles. Action start 15:17:10: CreateShortcuts. Action start 15:17:10: RegisterUser. Action start 15:17:10: RegisterProduct. Action start 15:17:10: PublishFeatures. Action start 15:17:10: PublishProduct. Action start 15:17:10: ConfigureInstaller. Action start 15:17:10: InstallFinalize. Action 15:17:10: ProcessComponents. Updating component registration Action 15:17:12: InstallFiles. Copying new files Action 15:17:21: CreateShortcuts. Creating shortcuts Action 15:17:21: RegisterProduct. Registering product Action 15:17:23: ConfigureInstaller. [[note: CustomAction]] Action 15:17:22: PublishFeatures. Publishing Product Features Begin CustomAction 'ConfigureInstaller' Action 15:17:28: RollbackCleanup. Removing backup files Action ended 15:17:28: InstallFinalize. Return value 1. Action start 15:17:28: RegisterShellExt. [[note: CustomAction]] Action ended 15:17:33: INSTALL. Return value 1. Action start 15:17:35: ExitDialog. Does anyone know an official listing?

    Read the article

  • Custom buttons in MS-Access 2k7

    - by terence6
    I'm adding some custom buttons to my forms in MS Access, but somehow I can't make them work. In buttons properties Event tab I've changed 'On Click' event to call 'Event procedure'. Then in VBasic I'm selecting my button and from what I know this code should give me prompt, and if Yos is selected the form should close. But when I click my buttons simply nothing happens. Am I doing something wrong ? Option Compare Database Option Explicit Private Sub cmdQuitApp_Click() If MsgBox("Are you sure you want to close the form?", vbYesNo + vbQuestion + vbInformation, "Clasing the form.") = vbYes Then DoCmd.Close End If End Sub

    Read the article

  • Add client-side events to ASP.Net custom control at runtime

    - by nw
    I'm building an ASP.net custom control that implements IScriptControl. I would like other users of my control to be able to assign client-side event handlers to the control. Unfortunately the JS generated by IScriptControl is always injected at the very bottom of the rendered page (see below), so any attempt to assign an event handler in the ASPX page fails because the code executes too early. ... <script type="text/javascript"> //<![CDATA[ Sys.Application.initialize(); Sys.Application.add_init(function() { $create(MyNamespace.MyControl, {}, null, null, $get("my_control_id")); }); //]]> </script> </form> What's the right way to assign an event handler to the instantiated control upon page load?

    Read the article

  • custom TreeNode and SelectNodeChanged

    - by gilloux
    Hello, I'm working on asp.net I've written a custom Treenode (customTreeNode) that I use to populate a treeview the problem comes up when firing the selectnodechanged event this event give me a TreeNode object and not a customTreeNode and I cannot seem to cast it somehow, does sy have a clue ? Thx here is the code I have populate my tree node.ChildNodes.Add ( customTreeNode = new customTreeNode(site) ); customTreeNode public class customTreeNode : TreeNode { public Guid Id { get; set; } private SPWebEntry _dataContext; public SPWebEntry DataContext { get { return _dataContext; } } public customTreeNode(SPWebEntry DataContext) { _dataContext = DataContext; this.Text = _dataContext.Title; this.Id = _dataContext.Id; } } and the event void treeViewSiteCollection_SelectedNodeChanged(object sender, EventArgs e) { treeViewSiteCollection.SelectedNode; } treeViewSiteCollection.SelectedNode is of type TreeNode and I cannot cast it. Thx guys

    Read the article

  • Error when saving document of custom type in Alfresco Share

    - by ht0ma
    I got this exception when trying to save a new document of custom type: org.alfresco.service.cmr.repository.MalformedNodeRefException: 06010026 Invalid node ref - does not contain forward slash: {node.nodeRef} Here is how the definition of the custom type looks like: <?xml version="1.0" encoding="UTF-8"?> <!-- Definition of new Model --> <model name="ht:channelmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <!-- Imports are required to allow references to definitions in other models --> <imports> <!-- Import Alfresco Dictionary Definitions --> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /> <!-- Import Alfresco Content Domain Model Definitions --> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" /> </imports> <!-- Introduction of new namespaces defined by this model --> <namespaces> <namespace uri="http://www.someco.com/model/content/1.0" prefix="ht" /> </namespaces> <types> <!-- Here comes my type --> <type name="ht:doc"> <title>Custom Document</title> <parent>cm:content</parent> <mandatory-aspects> <aspect>cm:generalclassifiable</aspect> </mandatory-aspects> </type> </types> <aspects> <aspect name="ht:channel"> <title>Content Channel</title> <properties> <property name="ht:isWeb"> <type>d:boolean</type> </property> </properties> </aspect> </aspects> </model> and here is how I set the forms for displaying the creation of a new document of my custom type (inside share-config-custom.xml) <alfresco-config> <config evaluator="string-compare" condition="DocumentLibrary"> <create-content> <content id="plain-text" mimetype="text/plain" label="Prompt" itemid="ht:doc" /> </create-content> <aspects> <visible> <aspect name="ht:channel" /> </visible> <addable> </addable> <removeable> </removeable> </aspects> <types> <type name="cm:content"> <subtype name="ht:doc" /> </type> </types> </config> <config evaluator="model-type" condition="ht:doc"> <forms> <form> <field-visibility> <show id="cm:title" force="true" /> <show id="ht:isWeb" force="true" /> </field-visibility> <appearance> <field id="cm:title"> <control template="/org/alfresco/components/form/controls/textfield.ftl" /> </field> </appearance> </form> </forms> </config> </alfresco-config> Is is something wrong with the formatting or am I missing some fields in the type definition? Thanks

    Read the article

  • RRAS won’t start with 8007042a or event ID 7024, aka the “routing remote access unable to load Iprtrmgr.dll”

    - by KCotreau
    History: The history of this error, which has mostly gone unsolved, dates back to Windows 2000. Platforms affected: Windows Server 2008 R2, Server 2008, Server 2003 R2, Server 2003, Server 2000 (both 32-bit and 64-bit installs are affected). Error Messages Event ID: 7024 The Routing and Remote Access service terminated with service-specific error 2 (0x2). Event ID: 7024 The Routing and Remote Access service terminated with service-specific error 31 (0x1F). Event ID: 7024 The Routing and Remote Access service terminated with service-specific error 20205 (0x4EED). Event ID: 7024 The Routing and Remote Access service terminated with service-specific error 193 (0xC1). Event ID: 20103 Unable to load C:\WINDOWS\System32\iprtrmgr.dll . (32-bit installs). Event ID: 20103 Unable to load C:\WINDOWS\SysWOW64\iprtrmgr.dll . (64-bit installs).

    Read the article

  • Add custom command line to extended context menu in Windows 7

    - by 280Z28
    I have an application pinned to the task bar. 90% of the time, I run it with no additional command line options, so I can either click it (if not already open), or right click the icon and click the application name to open a new instance. I want to make it where when I right click it, there are 2 options listed: the first is the program with no command line options and the second is the one with a custom command line (that I hard code). If this is impossible, it would be tolerable to add it to the extended context menu (shift + right click the icon), but I prefer the former.

    Read the article

  • What's wrong with my custom patch cables?

    - by stu42j
    I have a box of bulk Cat5e riser cable left over from when I had my house wired. I figured I could use this to make some custom length cables for connecting my computers, switches, etc. I had a crimper already so I bought a bag of RJ45 plugs. I made a few cables several years ago, but my experience/knowledge with this sort of thing is minimal. None of my cables are working. I don't have a tester so I just plug the cable into a computer and switch but I get no link light. I wired them them all straight-through and visual inspection doesn't show any problems. Any ideas what I might be doing wrong?

    Read the article

  • Unexpected results from custom partitioning scheme - Ubuntu preseed unattended install

    - by Mark Renouf
    Hi... I need some help with partman-auto custom recipe in preseed.... it's doing unexpected things, the docs aren't so clear. This is in my preseed file: d-i partman-auto/expert_recipe string \ boot-root-var :: \ 1024 100 1024 ext4 \ $primary{ } $bootable{ } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ mountpoint{ /boot } \ . \ 2048 50 4096 ext4 \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ mountpoint{ / } \ . \ 4096 25 100000 ext4 \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ mountpoint{ /var } \ . \ 256 75 100% linux-swap \ method{ swap } format{ } \ . Given an 80GB drive. I ended up with these partitions: / 2GB /boot 1GB /var 4GB swap 72GB What went wrong? What I want is: / 2GB /boot 1GB /var 72GB swap 4GB

    Read the article

  • Setting a custom timeout to nmblookup

    - by C2H5OH
    As part of a batch script, I have the following command: hostname=$(nmblookup -A $ip_address | awk '$2 == "<20>" {print $1}') Which works fine from a functinality perspective, even for unresolved hosts. The problem is that when the IP address is not reachable or the remote machine does not respond to the SMB request, the command takes about ten seconds to complete. Therefore, the question is simple: is there a way to lower the elapsed time in such cases? Or, in other words, is there a way to set a custom timeout for the nmblookup command? NOTE: I'm interested in solutions that do not make use of SIGALRM or similar mechanisms; if they exist. The nmblookup version is 3.6.3 from Ubuntu 12.04 LTS.

    Read the article

  • Add a custom certificate authority to Ubuntu

    - by rmrobins
    Hello; I have created a custom root certificate authority for an internal network, example.com. Ideally, I would like to be able to deploy the CA certificate associated with this certificate authority to my Linux clients (running Ubuntu 9.04 and CentOS 5.3), such that all of the applications automatically recognize the certificate authority (i.e. I do not want to have to configure Firefox, Thunderbird, etc manually to trust this certificate authority). I have attempted this on Ubuntu by copying the PEM-encoded CA certificate to /etc/ssl/certs/ and /usr/share/ca-certificates/, as well as by modifying /etc/ca-certificates.conf and rerunning update-ca-certificates, however applications do not seem to recognize that I have added another trusted CA to the system. Therefore, is it possible to add a CA certificate once to a system, or is it necessary to manually add the CA to all of the possible applications that will attempt to make SSL connections to hosts signed by this CA in my network? If it is possible to add a CA certificate once to the system, where does it need to go? Thanks.

    Read the article

  • Custom/personal dyndns solution?

    - by Eddie Parker
    Hey: I can't think of how to make this work, but it seems like something that should be doable.. I currently own my own domain, and have been using dyndns.com's "custom DNS" to allow me to redirect 'example.com' to my website at home, which is on a dynamic IP. I've now switched over to a VPS solution which hosts my website and allows me root access to a box (me likey), which will now host "example.com" on a static IP. My question is, is it possible for me to somehow make "home.example.com" route to my box at home? Is there any software available that could automate updates to the DNS for this? Ideally I'd like not to pay a service if possible, but if that's the only way then I suppose I'll have to go that way. Thanks!

    Read the article

  • emacs - Widget Custom Theme

    - by Abdillah
    I'm starting using emacs. I know that everything of emacs is customizable. But, one thing I can't even found on internet is modifying the default emacs' widget's Look and Feel. Is there some way to custom it's background, shape, etc or just using UTF-8 character (for example checkbox using ? character)? Well, as a new user, I was quite boring with the customize interface. Some kind of I want to change onto a flat-styled ui or a better one.

    Read the article

  • Windows XP/7: custom routing for VPN connection

    - by Peter Becker
    We are dealing with a badly configured VPN connection from a vendor, which set up the default gateway but doesn't route traffic anywhere beyond their VPN zone. I managed to do some ad-hoc routing to configure a computer in a way that it can reach the vendor's VPN, our local network as well as the internet. I then tried to turn this into a script, but that failed since the interface number of the VPN changes on every connection. Is there a way in Windows XP and/or Windows 7 to configure custom routing on the client side of a VPN connection? What I would like to do is to have a script running just after the connection comes up that changes the routing table (similar to an ifup script on UNIX).

    Read the article

  • How to drop packets in a custom Intrusion Detection System

    - by tzoukos
    Hi there, I'm trying to build a custom Intrusion Detection and Prevention System (IDS/IPS). I found a great utility named ROPE which can scan the packet payload and drop the packet that doesn't follow the rules, set by a script. This serves my purpose completely, since what I want to do is check the payload for some specific text and then drop it or allow it ( the string feature in iptables wouldn't do me any good, because I want to check more than one string in tha payload, like usernames, id's, etc ). However, ROPE is really old and despite my many attempts I haven't managed to install it properly. Do you know any similar program that will help me drop packets in iptables depending on the payload? Any suggestion is greatly appreciated :)

    Read the article

  • Removing a custom vim configuration

    - by Hovercouch
    I've added a lot of small mappings to my vimrc that help me work, like noremap H ^ and inoremap jk <esc>. It's diverged enough from vanilla vim that other people at work have trouble coding on my computer. This has been making it harder to pair program with people and get help reviewing code. What I'd like is a way to quickly toggle on/off all of my custom mappings and switch between my vim config and a more 'conventional' one (like relative vs absolute numbering). What would be the best way to do this?

    Read the article

  • Custom resolution - Windows 7 - no drivers

    - by Vytautas Butkus
    I'm having some problems with my VGA card. When I enable my VGA drivers and boot windows up they crash and I get message that the problem occured with atimdag.sys drivers or smth like that. I'm gettin BSOD all the time, unless I go to control panel and I disable drivers manually. I can live with disabled drivers just fine(I'm already used to it in quite some time) but the annoying problem is my display resolution. I can not set my res to anything higher than 1024x768. I was wondering if it's possible to change resolution to my native displays resolution without drivers? I've been trying to find something that would work w/o drivers, but with no luck(I've found many of solutions how to do it with working drivers, but as you know I can not enable my drivers). So please, maybe someone could help me and tell me how to set custom resolution?

    Read the article

  • Custom Filter in cPanel to Auto-Delete Emails with Russian Characters

    - by John Conde
    I get a lot of spam to my email account from Russia. The emails themselves (name, subject, body) are in Russian and I was hoping to create a custom filter in cPanel (not in SpamAssassin but in cPanel itself) to catch these emails and delete them before they hit my inbox. I've tried setting up rules to flag emails with these characters but they still are getting through. This leads me to believe that there is an encoding issue at play here. Unfortunately I do not know how to overcome this. Ideas?

    Read the article

  • moved wordpress site to rackspace cloud, now custom queries breaks code

    - by nikki
    Moved a wordpress site onto a rackspace account from a linux server. Everything is working except for any custom post queries that I programmed. these were working just fine before, and I have tested to make sure it is these queries that is breaking the code. For example here is a snippet that will make the page not load <?php query_posts( "p=215" ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <? the_content(); ?> <? endwhile; endif; wp_reset_query(); ?> Does anyone have any insights? My thoughts are that the switch to Rackspace account has something to do with it.

    Read the article

  • AD Custom Attribute with unique value

    - by Zilog
    I have custom AD attribute added to my AD schema. Attribute's syntax is Unicode String. It is added to user class and the purpose of it is to store user ID of corporate ERP system. Problem is, that I can have two or more user objects with the same value stored in that attribute, which is something that I would like to avoid. Is there a way to configure AD attribute so it is unique within the domain boundary? (The same behavior as SAMAccountName attribute.) i.e : If there already exists user object in AD with this attribute set to "JSmith" and I try to set that attribute with the same value for another user, Direcory Services will refuse to update that object and give me "already exists" error. Domain functional level is windows 2003.

    Read the article

< Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >