Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main.java.beans;
- import main.java.tools.SessionUtils;
- import javax.annotation.PostConstruct;
- import javax.faces.application.FacesMessage;
- import javax.faces.bean.ManagedBean;
- import javax.faces.bean.SessionScoped;
- import javax.faces.context.FacesContext;
- import javax.servlet.http.HttpSession;
- import java.io.Serializable;
- @ManagedBean(name = "Login", eager = true)
- @SessionScoped
- public class LoginBean implements Serializable {
- private static final long serialVersionUID = 1094801825228386363L;
- private String pwd;
- private String msg;
- private String user;
- @PostConstruct
- public synchronized void init() {
- System.out.println("LoginBean INIT....");
- ConfigBean configBean = new ConfigBean();
- configBean.loadConfigFromFile(configBean.configFile);
- }
- /**
- *
- * @param user the user
- * @param pwd the pw
- * @return bool
- */
- private synchronized boolean validateHardcoded(String user, String pwd) {
- ConfigBean configBean = new ConfigBean();
- return user.matches(configBean.getUser()) && pwd.matches(configBean.getPassword());
- }
- //validate login
- public synchronized String validateUsernamePassword() {
- boolean valid = validateHardcoded(user, pwd);
- if (valid) {
- HttpSession session = SessionUtils.getSession();
- session.setAttribute("username", user);
- return "gui";
- } else {
- FacesContext.getCurrentInstance().addMessage(
- null,
- new FacesMessage(FacesMessage.SEVERITY_WARN,
- "Incorrect Username and Passowrd",
- "Please enter correct username and Password"));
- return "index";
- }
- }
- //logout event, invalidate session
- public String logout() {
- HttpSession session = SessionUtils.getSession();
- session.invalidate();
- return "index";
- }
- public String getPwd() {
- return pwd;
- }
- public void setPwd(String pwd) {
- this.pwd = pwd;
- }
- public String getMsg() {
- return msg;
- }
- public void setMsg(String msg) {
- this.msg = msg;
- }
- public String getUser() {
- return user;
- }
- public void setUser(String user) {
- this.user = user;
- }
- }
- package main.java.beans;
- import main.java.jobs.ApplicationRunnable;
- import main.java.model.Feed;
- import main.java.tools.Emailer;
- import org.primefaces.push.annotation.Singleton;
- import org.quartz.*;
- import org.quartz.impl.StdSchedulerFactory;
- import javax.annotation.PostConstruct;
- import javax.annotation.PreDestroy;
- import javax.faces.bean.ApplicationScoped;
- import javax.faces.bean.ManagedBean;
- import java.io.*;
- import java.util.*;
- @Singleton
- @ManagedBean(name = "ConfigBean") //, eager = true
- @ApplicationScoped
- public class ConfigBean {
- public volatile long allXSeconds = 60; /* aggregates / searches / sends out all x seconds */
- /* email Config */
- public volatile String smtpHost;
- public volatile String smtpUser;
- public volatile String smtpPw;
- public volatile int smtpPort;
- public volatile String senderMail;
- public String serializationFile = "C:\\Users\JARE\Desktop\anderesZeug\feedLog.txt";
- public volatile String configFile = "C:\\Users\JARE\Desktop\anderesZeug\config.properties";
- /* login config */
- public volatile String user;
- public volatile String password;
- /* runtime fields */
- public volatile boolean runOnce = false;
- public volatile boolean running = true;
- public final List<Feed> sentNotifications = new ArrayList<>();
- public final List<String> emails = new ArrayList<>();
- public final List<String> words = new LinkedList<>();
- public final List<String> feeds = new LinkedList<>();
- /* fields to add to emails, words, feeds from gui.xhtml */
- private volatile String currentEmail;
- private volatile String currentFeed;
- private volatile String currentWord;
- Scheduler scheduler;
- @PostConstruct
- public synchronized void init() {
- loadConfigFromFile(configFile);
- try {
- sentNotifications.addAll(readFeedsFromFile(serializationFile));
- System.out.println("SENT SIZE: " + sentNotifications.size());
- } catch (IOException e) {
- e.printStackTrace();
- }
- System.out.println("Scheduling.... ");
- /* QUARTZ job scheduling */
- JobDetail job = JobBuilder.newJob(ApplicationRunnable.class)
- .withIdentity("ParseJob", "ServerJobs").build();
- // Trigger the job to run on the next round minute
- Trigger trigger = TriggerBuilder
- .newTrigger()
- .withIdentity("ParseJobTrigger", "ServerJobs")
- .withSchedule(
- SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds((int) allXSeconds).repeatForever()
- ).build();
- try {
- scheduler = new StdSchedulerFactory().getScheduler();
- scheduler.start();
- scheduler.scheduleJob(job, trigger);
- } catch (SchedulerException e) {
- e.printStackTrace();
- }
- }
- @PreDestroy
- public synchronized void destroy() {
- saveConfigToFile(configFile); //TODO
- try {
- scheduler.shutdown();
- } catch (SchedulerException e) {
- e.printStackTrace();
- }
- }
- /* Facelet methods */
- public synchronized void sendOldFeeds() {
- sendOldFeeds(currentEmail);
- }
- public synchronized void addEmail() {
- emails.add(currentEmail);
- }
- public synchronized void rmEmail(String email) {
- emails.remove(email);
- }
- public synchronized void addWord() {
- words.add(currentWord);
- }
- public synchronized void rmWord(String word) {
- words.remove(word);
- }
- public synchronized void addFeed() {
- feeds.add(currentFeed);
- }
- public synchronized void rmFeed(String feed) {
- feeds.remove(feed);
- }
- public synchronized void runItOnce() {
- runOnce = true;
- }
- public synchronized void startStop() {
- running = !running;
- }
- public synchronized void updateFreq() {
- }
- /* logic methods */
- /**
- * Load the Config from the config.properties File
- *
- * @param path ... path to the config-file
- */
- public synchronized void loadConfigFromFile(String path) {
- System.out.println("Loading Config....: ");
- Properties prop = new Properties();
- InputStream input = null;
- try {
- //input = new FileInputStream("config.properties");
- input = new FileInputStream(path);
- // load a properties file
- prop.load(input);
- // .... saved like this:
- // emails: abc@test.com, bbc@aab.com, .....
- String wordsS = prop.getProperty("keywords");
- String emailS = prop.getProperty("emails");
- String feedS = prop.getProperty("feeds");
- emails.addAll(Arrays.asList(emailS.split(",")));
- words.addAll(Arrays.asList(wordsS.split(",")));
- feeds.addAll(Arrays.asList(feedS.split(",")));
- allXSeconds = Long.valueOf(prop.getProperty("frequency"));
- serializationFile = prop.getProperty("serializationFile");
- configFile = prop.getProperty("configFile");
- smtpHost = prop.getProperty("smtpHost");
- smtpUser = prop.getProperty("smtpUser");
- smtpPw = prop.getProperty("smtpPw");
- smtpPort = Integer.valueOf(prop.getProperty("smtpPort"));
- senderMail = prop.getProperty("senderMail");
- user = prop.getProperty("loginUser");
- password = prop.getProperty("loginPw");
- System.out.println("config..:" + emails);
- System.out.println("config..:" + words);
- System.out.println("config..:" + feeds);
- System.out.println("config..:" + allXSeconds);
- System.out.println("config..:" + serializationFile);
- System.out.println("config..:" + configFile);
- System.out.println("config..:" + smtpHost);
- System.out.println("config..:" + smtpUser);
- System.out.println("config..:" + smtpPw);
- System.out.println("config..:" + senderMail);
- } catch (IOException ex) {
- ex.printStackTrace();
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
- /**
- * Save the config (emails, words, feeds, frequency) to a properties file
- *
- * @param path ... path to configfile
- */
- public synchronized void saveConfigToFile(String path) {
- System.out.println("Saving Config.... ");
- Properties prop = new Properties();
- OutputStream output = null;
- try {
- //output = new FileOutputStream("config.properties");
- output = new FileOutputStream(path);
- String feedsS = feeds.toString();
- String emailsS = emails.toString();
- String wordS = words.toString();
- // set the properties value
- List<Object> allConfs = new LinkedList<>();
- allConfs.add(emailsS);
- allConfs.add(feedsS);
- allConfs.add(wordS);
- allConfs.add(allXSeconds);
- allConfs.add(serializationFile);
- allConfs.add(configFile);
- allConfs.add(smtpHost);
- allConfs.add(smtpPw);
- allConfs.add(smtpUser);
- allConfs.add(smtpPort);
- allConfs.add(senderMail);
- allConfs.add(user);
- allConfs.add(password);
- if (!isNull(allConfs)) {
- prop.setProperty("emails", emailsS.substring(1, emailsS.length() - 1));
- prop.setProperty("keywords", wordS.substring(1, wordS.length() - 1));
- prop.setProperty("feeds", feedsS.substring(1, feedsS.length() - 1));
- prop.setProperty("frequency", String.valueOf(getAllXSeconds()));
- prop.setProperty("serializationFile", serializationFile);
- prop.setProperty("configFile", configFile);
- prop.setProperty("smtpHost", smtpHost);
- prop.setProperty("smtpUser", smtpUser);
- prop.setProperty("smtpPw", smtpPw);
- prop.setProperty("smtpPort", String.valueOf(smtpPort));
- prop.setProperty("senderMail", senderMail);
- prop.setProperty("user", user);
- prop.setProperty("password", password);
- // save properties to project root folder
- prop.store(output, null);
- } else {
- System.out.println("Config.properties wasn't serialized because something was null");
- }
- } catch (IOException io) {
- io.printStackTrace();
- } finally {
- if (output != null) {
- try {
- output.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
- /**
- * writes/serializes the feeds in sentNotifications into file
- *
- * @param feeds ...LinkedList<Feed> the linked list of feeds to be serialized
- * @param filePath ... path to the file used for storage
- * @throws IOException ... e.g. file not found or corrupted or whatever
- */
- public synchronized void writeFeedsIntoFile(List<Feed> feeds, String filePath) throws IOException {
- System.out.println("Writing feeds to file.... ");
- ObjectOutputStream oos = null;
- FileOutputStream fout;
- try {
- fout = new FileOutputStream(filePath, true);
- oos = new ObjectOutputStream(fout);
- oos.writeObject(feeds);
- oos.write(null); //TODO i hope this solves the EOF Exception..?
- } catch (EOFException ex) {
- ex.printStackTrace();
- System.out.println("Configbean: writeFeedsIntoFile threw a Exception");
- } finally {
- if (oos != null) {
- oos.close();
- }
- }
- }
- /**
- * Reads the feeds which have been sent from a file, parses them into Feeds
- *
- * @param filePath ... path to the storage file
- * @throws IOException ... e.g. file not found or corrupted or whatever
- */
- public synchronized List<Feed> readFeedsFromFile(String filePath) throws IOException {
- System.out.println("Reading feeds from file.... ");
- List<Feed> res = new ArrayList<>();
- ObjectInputStream oiS = null;
- try {
- List<Feed> readCase = null;
- FileInputStream streamIn = new FileInputStream(filePath);
- oiS = new ObjectInputStream(streamIn);
- readCase = (List<Feed>) oiS.readObject();
- if (readCase != null)
- res.addAll(readCase);
- } catch (StreamCorruptedException | EOFException | ClassNotFoundException e) {
- e.printStackTrace();
- } finally {
- if (oiS != null) {
- oiS.close();
- }
- }
- return res;
- }
- /**
- * Send an Email containing all previously sent Notifications
- *
- * @param toEmail .. the receipients email
- */
- public synchronized void sendOldFeeds(String toEmail) {
- System.out.println("Sending old feeds.... ");
- Emailer emailer = new Emailer();
- List<Feed> feeds = null;
- try {
- feeds = readFeedsFromFile(serializationFile);
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (feeds != null) {
- feeds.forEach(f -> emailer.sendMail(senderMail,
- toEmail,
- "Security Feed | " + f.getSubject(),
- f.getDescription() + "n" + f.getLink() + "n" + f.getDate(),
- smtpHost,
- smtpPort,
- smtpUser,
- smtpPw));
- }
- }
- /* STUPID UTILITY FUNCTIONS */
- public boolean isNull(List<Object> someObs) {
- return someObs.stream().anyMatch(Objects::isNull);
- }
- /* GETTER AND SETTER */
- public long getAllXSeconds() {
- return allXSeconds;
- }
- public void setAllXSeconds(long allXSeconds) {
- this.allXSeconds = allXSeconds;
- }
- public boolean isRunOnce() {
- return runOnce;
- }
- public void setRunOnce(boolean runOnce) {
- this.runOnce = runOnce;
- }
- public boolean isRunning() {
- return running;
- }
- public void setRunning(boolean running) {
- this.running = running;
- }
- public String getSerializationFile() {
- return serializationFile;
- }
- public void setSerializationFile(String serializationFile) {
- this.serializationFile = serializationFile;
- }
- public String getConfigFile() {
- return configFile;
- }
- public void setConfigFile(String configFile) {
- this.configFile = configFile;
- }
- public List<Feed> getSentNotifications() {
- return sentNotifications;
- }
- public List<String> getEmails() {
- return emails;
- }
- public List<String> getWords() {
- return words;
- }
- public List<String> getFeeds() {
- return feeds;
- }
- public String getCurrentEmail() {
- return currentEmail;
- }
- public void setCurrentEmail(String currentEmail) {
- this.currentEmail = currentEmail;
- }
- public String getCurrentFeed() {
- return currentFeed;
- }
- public void setCurrentFeed(String currentFeed) {
- this.currentFeed = currentFeed;
- }
- public String getCurrentWord() {
- return currentWord;
- }
- public void setCurrentWord(String currentWord) {
- this.currentWord = currentWord;
- }
- public String getSmtpHost() {
- return smtpHost;
- }
- public void setSmtpHost(String smtpHost) {
- this.smtpHost = smtpHost;
- }
- public String getSmtpUser() {
- return smtpUser;
- }
- public void setSmtpUser(String smtpUser) {
- this.smtpUser = smtpUser;
- }
- public String getSmtpPw() {
- return smtpPw;
- }
- public void setSmtpPw(String smtpPw) {
- this.smtpPw = smtpPw;
- }
- public int getSmtpPort() {
- return smtpPort;
- }
- public void setSmtpPort(int smtpPort) {
- this.smtpPort = smtpPort;
- }
- public String getSenderMail() {
- return senderMail;
- }
- public void setSenderMail(String senderMail) {
- this.senderMail = senderMail;
- }
- public String getUser() {
- return user;
- }
- public void setUser(String user) {
- this.user = user;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- }
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- >
- <h:body>
- <div style="text-align: center;"><h1> Security RSS-To-Email Feeder</h1></div>
- <h:form>
- <p>IsRunning: #{ConfigBean.running}</p>
- <h:commandButton action="#{ConfigBean.startStop}" value="Start Or Stop"></h:commandButton>
- <h:commandButton action="#{ConfigBean.runItOnce}" value="Run Once Now"></h:commandButton>
- </h:form>
- <h:form>
- <p>Welcome #{Login.user}</p>
- <h:commandButton action="#{Login.logout}" value="Logout"></h:commandButton>
- </h:form>
- <!-- FREQUENCY -->
- <h3>Configured RSS Readfrequency in Seconds</h3>
- <p>get and parse RSS-Feeds all #{ConfigBean.allXSeconds} Seconds</p>
- <h:form>
- <h:inputText value="#{ConfigBean.allXSeconds}" var="freq"/>
- <h:commandButton value="Set Frequency" action="#{ConfigBean.updateFreq}"/>
- </h:form>
- <!-- EMAILS -->
- <h3>Configured Emails</h3>
- <h:form>
- <h:inputText value="#{ConfigBean.currentEmail}" var="email"/>
- <h:commandButton value="Add Email" action="#{ConfigBean.addEmail}"/>
- </h:form>
- <h:form>
- <ui:repeat var="email" value="#{ConfigBean.emails}">
- <tr>
- <td>#{email}</td>
- <td>
- <f:facet name="header">Action</f:facet>
- <h:commandLink value="Delete" action="#{ConfigBean.rmEmail(email)}"/>
- </td>
- </tr>
- <br></br>
- </ui:repeat>
- </h:form>
- <br></br>
- <!-- FEEDS -->
- <h3>Configured Feeds</h3>
- <h:form>
- <h:inputText value="#{ConfigBean.currentFeed}" var="feed"/>
- <h:commandButton value="Add Feed" action="#{ConfigBean.addFeed}"/>
- </h:form>
- <h:form>
- <ui:repeat var="feed" value="#{ConfigBean.feeds}">
- <tr>
- <td>#{feed}</td>
- <td>
- <f:facet name="header">Action</f:facet>
- <h:commandLink value="Delete" action="#{ConfigBean.rmFeed(feed)}"/>
- </td>
- </tr>
- <br></br>
- </ui:repeat>
- </h:form>
- <br></br>
- <!-- KEYWORDS -->
- <h3>Configured Keywords</h3>
- <h:form>
- <h:inputText value="#{ConfigBean.currentWord}" var="word"/>
- <h:commandButton value="Add Keyword" action="#{ConfigBean.addWord}"/>
- </h:form>
- <h:form>
- <ui:repeat var="word" value="#{ConfigBean.words}">
- <tr>
- <td>#{word}</td>
- <td>
- <f:facet name="header">Action</f:facet>
- <h:commandLink value="Delete" action="#{ConfigBean.rmWord(word)}"/>
- </td>
- </tr>
- <br></br>
- </ui:repeat>
- </h:form>
- <br></br>
- <!-- SEND OLD FEEDS -->
- <h3>Send old matching feeds to email</h3>
- <h:form>
- <h:inputText value="#{ConfigBean.currentEmail}" var="email"/>
- <h:commandButton value="Send Feeds" action="#{ConfigBean.sendOldFeeds}"/>
- </h:form>
- <!-- CURRENT CONFIG -->
- <h3>Current Configuration</h3>
- Frequency: #{ConfigBean.allXSeconds} <br></br>
- Properties-Config: #{ConfigBean.configFile} <br></br>
- Serialisation-File: #{ConfigBean.serializationFile} <br></br>
- <!-- LATEST SENT -->
- <h3>Latest sent Feeds</h3>
- <!-- ALL SENT -->
- <h3>All sent Feeds</h3>
- <ui:repeat var="feed" value="#{ConfigBean.sentNotifications}">
- <tr>
- <td>#{feed.date}</td>
- <td>#{feed.subject}</td>
- <td>#{feed.description}</td>
- <td>#{feed.link}</td>
- </tr>
- <br></br>
- </ui:repeat>
- </h:body>
- </html>
- #Wed Aug 30 14:52:04 CEST 2017
- feeds=http://www.kb.cert.org/vulfeed, https://ics-cert.us-cert.gov/advisories/advisories.xml, https://ics-cert.us-cert.gov/alerts/alerts.xml
- serializationFile=C:\\Users\JARE\Desktop\feedLog.txt
- keywords= vuln, b,a
- frequency=100
- configFile=C:\\Users\JARE\Desktop\anderesZeug\config.properties
- emails=testemail@test.com
- smtpPort=25
- smtpHost=testsmtp.testsmtp.com
- smtpUser=svc-securityfeed
- smtpPw=svc-securityfeedPW
- senderMail=securityfeed@test.com
- loginUser=TEST
- loginPw=TESTTEST
- [2017-08-31T10:28:46.561+0200] [glassfish 5.0] [WARNING] [] [javax.enterprise.resource.webcontainer.jsf.lifecycle] [tid: _ThreadID=29 _ThreadName=http-listener-1(3)] [timeMillis: 1504168126561] [levelValue: 900] [[
- #{Login.validateUsernamePassword}: java.lang.NullPointerException
- javax.faces.FacesException: #{Login.validateUsernamePassword}: java.lang.NullPointerException
- at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
- at javax.faces.component.UICommand.broadcast(UICommand.java:330)
- at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:870)
- at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1418)
- at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
- at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
- at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
- at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
- at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:338)
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
- at main.java.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:36)
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
- at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)
- at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)
- at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
- at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
- at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
- at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
- at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
- at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
- at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
- at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
- at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
- at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
- at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
- at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
- at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
- at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
- at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
- at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
- at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
- at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
- ... 40 more
- Caused by: java.lang.NullPointerException
- at java.util.regex.Pattern.<init>(Pattern.java:1350)
- at java.util.regex.Pattern.compile(Pattern.java:1028)
- at java.util.regex.Pattern.matches(Pattern.java:1133)
- at java.lang.String.matches(String.java:2121)
- at main.java.beans.LoginBean.validateHardcoded(LoginBean.java:41)
- at main.java.beans.LoginBean.validateUsernamePassword(LoginBean.java:46)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:498)
- at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:181)
- at com.sun.el.parser.AstValue.invoke(AstValue.java:289)
- at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
- at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
- at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
- ... 41 more
- ]]
- [2017-08-31T10:28:46.579+0200] [glassfish 5.0] [FATAL] [jsf.context.exception.handler.log] [javax.enterprise.resource.webcontainer.jsf.context] [tid: _ThreadID=29 _ThreadName=http-listener-1(3)] [timeMillis: 1504168126579] [levelValue: 1100] [[
- JSF1073: javax.faces.FacesException erfasst während Verarbeitung von INVOKE_APPLICATION 5 : UIComponent-ClientId=, Message=#{Login.validateUsernamePassword}: java.lang.NullPointerException]]
- [2017-08-31T10:28:46.579+0200] [glassfish 5.0] [FATAL] [] [javax.enterprise.resource.webcontainer.jsf.context] [tid: _ThreadID=29 _ThreadName=http-listener-1(3)] [timeMillis: 1504168126579] [levelValue: 1100] [[
- #{Login.validateUsernamePassword}: java.lang.NullPointerException
- javax.faces.FacesException: #{Login.validateUsernamePassword}: java.lang.NullPointerException
- at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:90)
- at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
- at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
- at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
- at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:338)
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
- at main.java.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:36)
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
- at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)
- at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)
- at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
- at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
- at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
- at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
- at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
- at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
- at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
- at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
- at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
- at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
- at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
- at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
- at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
- at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
- at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
- at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
- at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: javax.faces.FacesException: #{Login.validateUsernamePassword}: java.lang.NullPointerException
- at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:119)
- at javax.faces.component.UICommand.broadcast(UICommand.java:330)
- at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:870)
- at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1418)
- at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
- ... 36 more
- Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
- at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
- at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
- ... 40 more
- Caused by: java.lang.NullPointerException
- at java.util.regex.Pattern.<init>(Pattern.java:1350)
- at java.util.regex.Pattern.compile(Pattern.java:1028)
- at java.util.regex.Pattern.matches(Pattern.java:1133)
- at java.lang.String.matches(String.java:2121)
- at main.java.beans.LoginBean.validateHardcoded(LoginBean.java:41)
- at main.java.beans.LoginBean.validateUsernamePassword(LoginBean.java:46)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:498)
- at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:181)
- at com.sun.el.parser.AstValue.invoke(AstValue.java:289)
- at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
- at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
- at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
- ... 41 more
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement