473,738 Members | 2,492 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 2274
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
2556
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
1897
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
1625
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
2169
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
5659
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
1204
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
10131
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
4212
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
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9473
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
9334
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...
0
8208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
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
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.