473,698 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ 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 2271
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.com mons.digester.D igester.sax). log4j:WARN Please initialize the log4j system properly. Dec 31, 2008 1:43:57 PM org.apache.cata lina.core.Stand ardContext start INFO: Container org.apache.cata lina.core.Conta inerBase.[Catalina].[localhost].[/Login] has already been started java.lang.NullP ointerException at CRC.AlfrescoSer vices.getServic eRegistry(Alfre scoServices.jav a:52) at CRC.AlfrescoSer vices.getAuthen ticationService (AlfrescoServic es.java:36) at CRC.AlfUserServ ices.login(AlfU serServices.jav a:28) at CRC.CrcLogin.Ch eck_Valid


**************
This is the my code which has the problem :
package CRC;
import java.io.Seriali zable;
import java.beans.Even tHandler;
import java.util.Date;
import javax.faces.con text.FacesConte xt;
import javax.servlet.h ttp.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.prin tln(alfUserServ ices.login(getU serName(),getPa ssWord()));

System.out.prin tln(getUserName ()+" : "+getPassWord() );
FacesContext context =FacesContext.g etCurrentInstan ce();
HttpSession session=(HttpSe ssion) context.getExte rnalContext().g etSession(true) ;
System.out.prin tln(session);

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

System.out.prin tln(alfUserServ ices.login(getU serName(),getPa ssWord()));
return"success" ;
}







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

return"failed"; */



public String getUserName() {
return UserName;
}

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

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

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


package CRC;

import org.springframe work.beans.Bean sException;
import org.springframe work.context.Ap plicationContex t;
import org.springframe work.context.Ap plicationContex tAware;

/**
*
* @author SPAREWNMAN
*/


public class ContextAwareCla ss implements ApplicationCont extAware {

private static ApplicationCont ext ctx;

public void setApplicationC ontext(Applicat ionContext applicationCont ext)
throws BeansException {
ctx = applicationCont ext;
}

public static void displayAppConte xt() {
System.out.prin tln(ctx);
}

public static ApplicationCont ext getAppContext() {
return ctx;

}




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

}

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



package CRC;

import org.alfresco.se rvice.ServiceRe gistry;
import org.alfresco.se rvice.cmr.secur ity.Authenticat ionService;
import org.springframe work.context.Ap plicationContex t;


/**
*
* @author SPAREWNMAN
*/
public class AlfrescoService s {

private ServiceRegistry serviceRegistry ;
private AuthenticationS ervice authenticationS ervice;
/** Creates a new instance of AlfrescoService s */
public AlfrescoService s() {
}

protected void setAuthenticati onService(
AuthenticationS ervice authenticationS ervice) {
this.authentica tionService = authenticationS ervice;
}

protected AuthenticationS ervice getAuthenticati onService() {
if (authentication Service == null)
authenticationS ervice = getServiceRegis try()
.getAuthenticat ionService();
return authenticationS ervice;
}

protected void setServiceRegst ry(ServiceRegis try serviceRegstry) {
this.serviceReg istry = serviceRegstry;
}

protected ServiceRegistry getServiceRegis try() {
if (serviceRegistr y == null) {
ApplicationCont ext ctx = ContextAwareCla ss.getAppContex t();

//ApplicationCont ext ctx = ApplicationCont extHelper
//.getApplication Context();

serviceRegistry = (ServiceRegistr y) ctx
.getBean(Servic eRegistry.SERVI CE_REGISTRY);
}

return serviceRegistry ;


}
}

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


package CRC;

import org.alfresco.se rvice.cmr.secur ity.Authenticat ionService;
import java.util.Hasht able;
import java.util.Map;
import org.alfresco.mo del.ContentMode l;
/**
*
* @author SPAREWNMAN
*/
public class AlfUserServices extends AlfrescoService s {

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

public boolean login(String username,String password){
try{
AuthenticationS ervice authenticationS ervice = getAuthenticati onService();
authenticationS ervice.authenti cate(username, password.toChar Array());
}
catch(Exception e){e.printStack Trace();

return false;}
return true;
}

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

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

Similar topics

1
2553
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 problem was that there was a package statement as the first line of the code generated by Borland's JBuilder IDE. Yes, I used JBuidler's form designer to create it. I don't normally worry about adding "package" to code I write, and didn't much care...
6
1896
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 want to derive from "file" to create a class that reads record from a binary file:
1
1624
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 Python source files a program uses, if you want to back up a program or send it to a colleague. Has anyone written a Python tool that looks at all the Python source files in a directory and constructs lists of sources, each of which comprises a...
11
2165
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 that will transform these to x,y coordinates using an affine transform. I'd like it to look something like this (but this clearly doesn't work): class myFile(file): def __init__(self,name,affine):
9
715
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 anyway).... Private Sub LogChange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs) If e.ChangeType = WatcherChangeTypes.Created Then
2
5657
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" size="70" runat="Server"> <input type="text" SIZE="20" MAXLENGTH="20" id="Name" NAME="Name"> <input type="submit" id="Submit" runat="Server" value="Submit" OnServerClick="SubmitButton_Click"> </form>
0
1202
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 same procedure, but it doesn't work . A "ReadError" appear: "not a bzip2 file". I'm using this script: import os import tarfile
2
10120
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 = 'C:/users/saftarn/desktop/images/blob4.jpg') #im = file = 'C:/users/me/desktop/images/blob4.jpg'
0
4206
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 drives. Does anyone know what might be causing this?
0
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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 we have to send another system
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.