473,467 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to make join between "JAR file and JSF"

5 New Member
Dear All,

Hope every one is feeling good, and happy new year .

Can any one help me on this?
I built an Alfreasco code and it works on eclipse, now on eclipse I made in the "main class" username and password (desktop application) and when I send the username and password it returns true , but on web Application when I take tha Jar file and use JSF code on netbeans and then enter the username and password it gives me an error like this:

Null pointer exception :
on Get Authuntication error
and on Registry service

So How I mada a "login page on jsf and connect it to the jar file?
Dec 31 '08 #1
1 2260
isra123
5 New Member
@isra123
ah by the way the error I got is:

og4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax). log4j:WARN Please initialize the log4j system properly. Dec 31, 2008 1:43:57 PM org.apache.catalina.core.StandardContext start INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Login] has already been started java.lang.NullPointerException at CRC.AlfrescoServices.getServiceRegistry(AlfrescoSe rvices.java:52) at CRC.AlfrescoServices.getAuthenticationService(Alfr escoServices.java:36) at CRC.AlfUserServices.login(AlfUserServices.java:28) at CRC.CrcLogin.Check_Valid


**************
This is the my code which has the problem :
package CRC;
import java.io.Serializable;
import java.beans.EventHandler;
import java.util.Date;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
/*
* CrcLogin.java
*
* Created on November 30, 2008, 12:30 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

/**
*
* @author SPAREWNMAN
*/
public class CrcLogin {

/** Creates a new instance of CrcLogin */
public CrcLogin() {
}

private String UserName;
private String PassWord;

public String Check_Validate()
{

AlfUserServices alfUserServices=new AlfUserServices();

System.out.println(alfUserServices.login(getUserNa me(),getPassWord()));

System.out.println(getUserName()+" : "+getPassWord());
FacesContext context =FacesContext.getCurrentInstance();
HttpSession session=(HttpSession) context.getExternalContext().getSession(true);
System.out.println(session);

System.out.println(UserName + " has logged in at " + new Date());

System.out.println(alfUserServices.login(getUserNa me(),getPassWord()));
return"success";
}







/*else
System.out.println(getUserName()+" : "+getPassWord());
System.out.println("Invalide User");

return"failed";*/



public String getUserName() {
return UserName;
}

public void setUserName(String UserName) {
this.UserName = UserName;
}

public void setPassWord(String PassWord) {
this.PassWord = PassWord;
}

public String getPassWord() {
return PassWord;
}
}
================================================== ===========================================
================================================== ===========================================


package CRC;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAwar e;

/**
*
* @author SPAREWNMAN
*/


public class ContextAwareClass implements ApplicationContextAware {

private static ApplicationContext ctx;

public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
ctx = applicationContext;
}

public static void displayAppContext() {
System.out.println(ctx);
}

public static ApplicationContext getAppContext() {
return ctx;

}




/** Creates a new instance of ContextAwareClass */
public ContextAwareClass() {
}

}

================================================== ===========================================
================================================== ===========================================



package CRC;

import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.security.AuthenticationSe rvice;
import org.springframework.context.ApplicationContext;


/**
*
* @author SPAREWNMAN
*/
public class AlfrescoServices {

private ServiceRegistry serviceRegistry;
private AuthenticationService authenticationService;
/** Creates a new instance of AlfrescoServices */
public AlfrescoServices() {
}

protected void setAuthenticationService(
AuthenticationService authenticationService) {
this.authenticationService = authenticationService;
}

protected AuthenticationService getAuthenticationService() {
if (authenticationService == null)
authenticationService = getServiceRegistry()
.getAuthenticationService();
return authenticationService;
}

protected void setServiceRegstry(ServiceRegistry serviceRegstry) {
this.serviceRegistry = serviceRegstry;
}

protected ServiceRegistry getServiceRegistry() {
if (serviceRegistry == null) {
ApplicationContext ctx = ContextAwareClass.getAppContext();

//ApplicationContext ctx = ApplicationContextHelper
//.getApplicationContext();

serviceRegistry = (ServiceRegistry) ctx
.getBean(ServiceRegistry.SERVICE_REGISTRY);
}

return serviceRegistry;


}
}

================================================== ===========================================
================================================== ===========================================


package CRC;

import org.alfresco.service.cmr.security.AuthenticationSe rvice;
import java.util.Hashtable;
import java.util.Map;
import org.alfresco.model.ContentModel;
/**
*
* @author SPAREWNMAN
*/
public class AlfUserServices extends AlfrescoServices {

/** Creates a new instance of AlfUserServices */
public AlfUserServices() {
}

public boolean login(String username,String password){
try{
AuthenticationService authenticationService = getAuthenticationService();
authenticationService.authenticate(username, password.toCharArray());
}
catch(Exception e){e.printStackTrace();

return false;}
return true;
}

}
================================================== ===========================================
================================================== ===========================================
Dec 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ted Byers | last post by:
I have gotten to the point where attempting to run my application using "java -jar HotSpotImageTest.jar" no longer generates a complaint about not finding function main. It turned out that the...
6
by: Uwe Mayer | last post by:
Hi, when extending a build in class, what does the constructor __init__(...) have to return? and how does the constructor call its base-class construtor? (or is this done automatically?) I...
1
by: beliavsky | last post by:
I know that you do not need a make file to run a Python program -- it looks for the needed sources files in the working directory and in directories in the path. But it is convenient to know what...
11
by: David Morgenthaler | last post by:
How does one overide the iterator implied by the construct "for line in file:"? For example, suppose I have a file containing row,col pairs on each line, and I wish to write a subclass of file...
9
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit...
2
by: IkBenHet | last post by:
Hello, I am uploading a file using this form in ASP.NET. I have also added a simpel textfield: <form runat="server" enctype="multipart/form-data"> <input type="file" id="oFile" Name="oFile"...
0
by: itzel | last post by:
Hello!! In using tarfile to group thousands of small files from a directory and then compress it. I already compress a group of files in my pc, but I need do it in a server and I'm testing the...
2
by: defn noob | last post by:
from Tkinter import * import os master = Tk() w = Canvas(master, width=800, height=600) print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg') im = PhotoImage(file =...
0
by: rangi500 | last post by:
Hello, We've recently started getting errors like this: Last error: ERROR: could not write to hash-join temporary file: No space left on device But there is plenty of space on the all the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.