JSP- Cannot import another JSP fileHow do you import classes in JSP?JSP tricks to make templating easier?What is the difference between JSF, Servlet and JSP?How to upload files to server using JSP/Servlet?How to avoid Java code in JSP files?if…else within JSP or JSTLInclude another JSP file“Import cannot be resolved” with JSPWhat's the difference between including files with JSP include directive, JSP include action and using JSP Tag Files?Glassfish loads JavaScript files really slow (> 1 minute)
Is the infant mortality rate among African-American babies in Youngstown, Ohio greater than that of babies in Iran?
How "fast" do astronomical events occur?
How to write a nice frame challenge?
Fill the maze with a wall-following Snake until it gets stuck
Object-oriented design implementation of an Elevator
Harmonic Series Phase Difference?
Why we can't jump without bending our knees?
I just entered the USA without passport control at Atlanta airport
Who was the youngest Executive Producer?
Digital signature that is only verifiable by one specific person
Using roof rails to set up hammock
Print the new site header
How to use random to choose colors
how to find which software is doing ssh connection?
How to address players struggling with simple controls?
If the mass of the Earth is decreasing by sending debris in space, does its angular momentum also decrease?
In a Fish that is not a Fish
Leaving job close to major deadlines
Should I email my professor to clear up a (possibly very irrelevant) awkward misunderstanding?
Is a sequel allowed to start before the end of the first book?
Is it a bad idea to have a pen name with only an initial for a surname?
Can a character with the Polearm Master feat make an opportunity attack against an invisible creature that enters their reach?
What kind of chart is this?
How to sort human readable size
JSP- Cannot import another JSP file
How do you import classes in JSP?JSP tricks to make templating easier?What is the difference between JSF, Servlet and JSP?How to upload files to server using JSP/Servlet?How to avoid Java code in JSP files?if…else within JSP or JSTLInclude another JSP file“Import cannot be resolved” with JSPWhat's the difference between including files with JSP include directive, JSP include action and using JSP Tag Files?Glassfish loads JavaScript files really slow (> 1 minute)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to call my other JSP page in my current JSP page. Basically in my editUrl.jsp
, I want to include genurl.jsp
as well.
From what I know, the way to do it is either:
<jsp:include page="file.jsp" />
or
<%@ include file="filename" %>
So I followed the method and did it like below:
<%@ include file="genurl.jsp" %>
When I run my program, it throws a nullpointer exception meaning it couldn't locate this file. I checked my root folder and they are both located in the same folder. Here is a screenshot for reference.
Am I doing anything wrong?
My genurl.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../../WEB-INF/jspf/mcre.jspf" %>
<%@include file="../../../WEB-INF/jspf/session.jspf"%>
<%@ page import="com.htasia.panton9.Core.Settings.SettingsFacadeLocal" %>
<%@page import="com.htasia.panton9.Utilities.CoreUtil,
com.htasia.MCRE.File.*,
com.htasia.MCRE.Types.*,
com.htasia.panton9.Core.Node.*,
com.htasia.panton9.Entities.Core.Node,
com.htasia.panton9.Entities.MCRE.*"%>
<%@ page import="javax.persistence.EntityManager" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="java.security.SecureRandom" %>
<%@ page import="java.math.BigInteger" %>
<html>
<%
String relPath = "../../../";
NodeFacadeLocal nFacade = null;
InitialContext ntx = new InitialContext();
try
nFacade = (NodeFacadeLocal) ntx.lookup("java:comp/env/node");
catch (NamingException e)
e.printStackTrace();
%>
<head>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win-2.js"></script>
<title>Generate URL</title>
</head>
<body>
<div id="table123" style="overflow:scroll;height:400px;width:100%;overflow:auto">
<table class="filesTbl">
<tr>
<th width="1%">
Checkbox
</th>
<th width="1%">
No
</th>
<th width="20%">
File Name
</th>
<th width="50%">
Unique URL
</th>
<th width="1%">
Edit
</th>
<th width="1%">
Copy
</th>
<th width="1%">
Email
</th>
</tr>
<%
//need to input logic to populate data on each row
int counter=0;
int tally=0;
String[] split = request.getParameter("nodeID").split(",",0);
for(int i=0;i<split.length;i++)
long file=Long.parseLong(split[i]);
List files = fileFacade.list_items(file);
for (Iterator rstltr = files.iterator(); rstltr.hasNext();)
Fmedia fv = (Fmedia) rstltr.next();
Node nd = nodeFacade.get(fv.getNodeid(), false);
// Fmedia fm = fileFacade.get_file(fv.getNodeid());
int count = 0;
count++;
long fileid= nd.getNodeid();
SettingsFacadeLocal settingFacade = (SettingsFacadeLocal)ctx.lookup("java:comp/env/settings");
String redirectURL = settingFacade.get("SERVER_URL").getAtval();
//declare a timestamp for unique URL
// String timeStamp=new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new java.util.Date());
// String hash = org.apache.commons.codec.digest.DigestUtils.sha256Hex(timeStamp);
SecureRandom secureRandom=new SecureRandom();
byte[] token = new byte[12];
secureRandom.nextBytes(token);
String hash= new BigInteger(1, token).toString(12);
%>
<tbody>
<tr>
<td width="5%">
<script>
// function to copy multiple URL links
function copymultiplelink()
var selectedFiles = $('.fileCheck:checked');
if(selectedFiles.length < 1 )
alert("Please select at least one file.");
return false;
var filesList = [];
var $fileChecks = $('.fileCheck:checked');
$fileChecks.each(function()
filesList.push($(this).val());
);
alert("You have copied " + filesList.length+ " URL");
copyURL(filesList.join("n"),false);
//function to call the edit the page
function editURL(filename,url)
var x=document.getElementById("table123");
x.style.display="none";
$('body').pWin("open",
x: 260,
y: 47,
height: 450,
width: 881,
title: "Edit:Advance Configuration",
skinMode:'dialog',
iframe:true,
url: "editUrl.jsp",
data:
filename:filename,
link:url
,
offResize:true,
offMove:true,
onTitle:false,
offBottom:true
);
// x.style.display="none";
</script>
<!--Display Checkbox -->
<input type="checkbox" class="fileCheck" id="<%=tally=tally+1%>" value="<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>" />
</td>
<td>
<!--Display No -->
<% counter=counter+1;
out.print(counter);
%>
</td>
<td width="28%">
<!-- Display Filename -->
<%=nd.getNodedesc()%>
</td>
<td width="100%">
<!-- Display Unique URL -->
<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>
<%
fileFacade.insert_url(nd.getNodeid(),"f0="+nd.getNodeid()+"&ts="+hash);
//fileFacade.insert_url(nd.getNodeid(),"syscont url/repository/file/view/viewPDF.jsp?url);
%>
</td>
<td>
<!-- Display EDIT/DEL -->
<input type="button" value="Edit URL" onclick="editURL('<%=nd.getNodedesc()%>','<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>')" >
</td>
<td> <!-- Display COPY feature -->
<input type="button" value="Copy URL" onclick="copyURL('<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>',true)">
</td>
</tr>
</tbody>
<%
%>
<script>
function copyURL(url,showMsg)
var copyText = url;
var el = document.createElement('textarea');
el.value = copyText;
el.setAttribute('readonly', '');
el.style =
position: 'absolute',
left: '-9999px'
;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
if(showMsg==true)
alert("You have copied the URL");
</script>
</table>
<!--Copy button to copy multiple links -->
<div class="wrapper">
<button type="button" onclick="copymultiplelink()"> Copy Selected URL</button>
</div>
</div>
<style>
.wrapper
position: absolute;
top: 90%;
left: 5%;
</style>
</body>
</html>
EDIT:
Full exception trace:
[2019-03-25T13:17:18.792+0800] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1553491038792] [levelValue: 900] [[
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.repository.file.url.editUrl_jsp._jspService(editUrl_jsp.java:349)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
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:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
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:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:722)
]]
[2019-03-25T13:48:44.442+0800] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=185 _ThreadName=ContainerBackgroundProcessor[StandardEngine[glassfish-web].StandardHost[server].StandardContext[]]] [timeMillis: 1553492924442] [levelValue: 800] [[
Session event listener threw exception
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:72)
at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:64)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:771)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:1056)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:6371)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1823)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1812)
at java.lang.Thread.run(Thread.java:722)
]]
jsp
|
show 1 more comment
I am trying to call my other JSP page in my current JSP page. Basically in my editUrl.jsp
, I want to include genurl.jsp
as well.
From what I know, the way to do it is either:
<jsp:include page="file.jsp" />
or
<%@ include file="filename" %>
So I followed the method and did it like below:
<%@ include file="genurl.jsp" %>
When I run my program, it throws a nullpointer exception meaning it couldn't locate this file. I checked my root folder and they are both located in the same folder. Here is a screenshot for reference.
Am I doing anything wrong?
My genurl.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../../WEB-INF/jspf/mcre.jspf" %>
<%@include file="../../../WEB-INF/jspf/session.jspf"%>
<%@ page import="com.htasia.panton9.Core.Settings.SettingsFacadeLocal" %>
<%@page import="com.htasia.panton9.Utilities.CoreUtil,
com.htasia.MCRE.File.*,
com.htasia.MCRE.Types.*,
com.htasia.panton9.Core.Node.*,
com.htasia.panton9.Entities.Core.Node,
com.htasia.panton9.Entities.MCRE.*"%>
<%@ page import="javax.persistence.EntityManager" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="java.security.SecureRandom" %>
<%@ page import="java.math.BigInteger" %>
<html>
<%
String relPath = "../../../";
NodeFacadeLocal nFacade = null;
InitialContext ntx = new InitialContext();
try
nFacade = (NodeFacadeLocal) ntx.lookup("java:comp/env/node");
catch (NamingException e)
e.printStackTrace();
%>
<head>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win-2.js"></script>
<title>Generate URL</title>
</head>
<body>
<div id="table123" style="overflow:scroll;height:400px;width:100%;overflow:auto">
<table class="filesTbl">
<tr>
<th width="1%">
Checkbox
</th>
<th width="1%">
No
</th>
<th width="20%">
File Name
</th>
<th width="50%">
Unique URL
</th>
<th width="1%">
Edit
</th>
<th width="1%">
Copy
</th>
<th width="1%">
Email
</th>
</tr>
<%
//need to input logic to populate data on each row
int counter=0;
int tally=0;
String[] split = request.getParameter("nodeID").split(",",0);
for(int i=0;i<split.length;i++)
long file=Long.parseLong(split[i]);
List files = fileFacade.list_items(file);
for (Iterator rstltr = files.iterator(); rstltr.hasNext();)
Fmedia fv = (Fmedia) rstltr.next();
Node nd = nodeFacade.get(fv.getNodeid(), false);
// Fmedia fm = fileFacade.get_file(fv.getNodeid());
int count = 0;
count++;
long fileid= nd.getNodeid();
SettingsFacadeLocal settingFacade = (SettingsFacadeLocal)ctx.lookup("java:comp/env/settings");
String redirectURL = settingFacade.get("SERVER_URL").getAtval();
//declare a timestamp for unique URL
// String timeStamp=new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new java.util.Date());
// String hash = org.apache.commons.codec.digest.DigestUtils.sha256Hex(timeStamp);
SecureRandom secureRandom=new SecureRandom();
byte[] token = new byte[12];
secureRandom.nextBytes(token);
String hash= new BigInteger(1, token).toString(12);
%>
<tbody>
<tr>
<td width="5%">
<script>
// function to copy multiple URL links
function copymultiplelink()
var selectedFiles = $('.fileCheck:checked');
if(selectedFiles.length < 1 )
alert("Please select at least one file.");
return false;
var filesList = [];
var $fileChecks = $('.fileCheck:checked');
$fileChecks.each(function()
filesList.push($(this).val());
);
alert("You have copied " + filesList.length+ " URL");
copyURL(filesList.join("n"),false);
//function to call the edit the page
function editURL(filename,url)
var x=document.getElementById("table123");
x.style.display="none";
$('body').pWin("open",
x: 260,
y: 47,
height: 450,
width: 881,
title: "Edit:Advance Configuration",
skinMode:'dialog',
iframe:true,
url: "editUrl.jsp",
data:
filename:filename,
link:url
,
offResize:true,
offMove:true,
onTitle:false,
offBottom:true
);
// x.style.display="none";
</script>
<!--Display Checkbox -->
<input type="checkbox" class="fileCheck" id="<%=tally=tally+1%>" value="<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>" />
</td>
<td>
<!--Display No -->
<% counter=counter+1;
out.print(counter);
%>
</td>
<td width="28%">
<!-- Display Filename -->
<%=nd.getNodedesc()%>
</td>
<td width="100%">
<!-- Display Unique URL -->
<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>
<%
fileFacade.insert_url(nd.getNodeid(),"f0="+nd.getNodeid()+"&ts="+hash);
//fileFacade.insert_url(nd.getNodeid(),"syscont url/repository/file/view/viewPDF.jsp?url);
%>
</td>
<td>
<!-- Display EDIT/DEL -->
<input type="button" value="Edit URL" onclick="editURL('<%=nd.getNodedesc()%>','<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>')" >
</td>
<td> <!-- Display COPY feature -->
<input type="button" value="Copy URL" onclick="copyURL('<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>',true)">
</td>
</tr>
</tbody>
<%
%>
<script>
function copyURL(url,showMsg)
var copyText = url;
var el = document.createElement('textarea');
el.value = copyText;
el.setAttribute('readonly', '');
el.style =
position: 'absolute',
left: '-9999px'
;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
if(showMsg==true)
alert("You have copied the URL");
</script>
</table>
<!--Copy button to copy multiple links -->
<div class="wrapper">
<button type="button" onclick="copymultiplelink()"> Copy Selected URL</button>
</div>
</div>
<style>
.wrapper
position: absolute;
top: 90%;
left: 5%;
</style>
</body>
</html>
EDIT:
Full exception trace:
[2019-03-25T13:17:18.792+0800] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1553491038792] [levelValue: 900] [[
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.repository.file.url.editUrl_jsp._jspService(editUrl_jsp.java:349)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
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:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
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:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:722)
]]
[2019-03-25T13:48:44.442+0800] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=185 _ThreadName=ContainerBackgroundProcessor[StandardEngine[glassfish-web].StandardHost[server].StandardContext[]]] [timeMillis: 1553492924442] [levelValue: 800] [[
Session event listener threw exception
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:72)
at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:64)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:771)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:1056)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:6371)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1823)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1812)
at java.lang.Thread.run(Thread.java:722)
]]
jsp
Edited my post pls help
– Daredevil
Mar 25 at 6:42
The code in file "genurl.jsp" bothers you. Post the code if available.
– adatapost
Mar 25 at 7:20
Yea because if I removed it,it works.
– Daredevil
Mar 25 at 7:27
Edited my post, it might be appear a bit long but it's better to post it
– Daredevil
Mar 25 at 7:29
It is throwing NPE, means in your jsp java code is throwing NPE. While importing it, it is throwing so no problem with your import. Problem with your genurl.jsp file. Add not null condition if required.
– Sudhakar
Mar 25 at 13:24
|
show 1 more comment
I am trying to call my other JSP page in my current JSP page. Basically in my editUrl.jsp
, I want to include genurl.jsp
as well.
From what I know, the way to do it is either:
<jsp:include page="file.jsp" />
or
<%@ include file="filename" %>
So I followed the method and did it like below:
<%@ include file="genurl.jsp" %>
When I run my program, it throws a nullpointer exception meaning it couldn't locate this file. I checked my root folder and they are both located in the same folder. Here is a screenshot for reference.
Am I doing anything wrong?
My genurl.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../../WEB-INF/jspf/mcre.jspf" %>
<%@include file="../../../WEB-INF/jspf/session.jspf"%>
<%@ page import="com.htasia.panton9.Core.Settings.SettingsFacadeLocal" %>
<%@page import="com.htasia.panton9.Utilities.CoreUtil,
com.htasia.MCRE.File.*,
com.htasia.MCRE.Types.*,
com.htasia.panton9.Core.Node.*,
com.htasia.panton9.Entities.Core.Node,
com.htasia.panton9.Entities.MCRE.*"%>
<%@ page import="javax.persistence.EntityManager" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="java.security.SecureRandom" %>
<%@ page import="java.math.BigInteger" %>
<html>
<%
String relPath = "../../../";
NodeFacadeLocal nFacade = null;
InitialContext ntx = new InitialContext();
try
nFacade = (NodeFacadeLocal) ntx.lookup("java:comp/env/node");
catch (NamingException e)
e.printStackTrace();
%>
<head>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win-2.js"></script>
<title>Generate URL</title>
</head>
<body>
<div id="table123" style="overflow:scroll;height:400px;width:100%;overflow:auto">
<table class="filesTbl">
<tr>
<th width="1%">
Checkbox
</th>
<th width="1%">
No
</th>
<th width="20%">
File Name
</th>
<th width="50%">
Unique URL
</th>
<th width="1%">
Edit
</th>
<th width="1%">
Copy
</th>
<th width="1%">
Email
</th>
</tr>
<%
//need to input logic to populate data on each row
int counter=0;
int tally=0;
String[] split = request.getParameter("nodeID").split(",",0);
for(int i=0;i<split.length;i++)
long file=Long.parseLong(split[i]);
List files = fileFacade.list_items(file);
for (Iterator rstltr = files.iterator(); rstltr.hasNext();)
Fmedia fv = (Fmedia) rstltr.next();
Node nd = nodeFacade.get(fv.getNodeid(), false);
// Fmedia fm = fileFacade.get_file(fv.getNodeid());
int count = 0;
count++;
long fileid= nd.getNodeid();
SettingsFacadeLocal settingFacade = (SettingsFacadeLocal)ctx.lookup("java:comp/env/settings");
String redirectURL = settingFacade.get("SERVER_URL").getAtval();
//declare a timestamp for unique URL
// String timeStamp=new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new java.util.Date());
// String hash = org.apache.commons.codec.digest.DigestUtils.sha256Hex(timeStamp);
SecureRandom secureRandom=new SecureRandom();
byte[] token = new byte[12];
secureRandom.nextBytes(token);
String hash= new BigInteger(1, token).toString(12);
%>
<tbody>
<tr>
<td width="5%">
<script>
// function to copy multiple URL links
function copymultiplelink()
var selectedFiles = $('.fileCheck:checked');
if(selectedFiles.length < 1 )
alert("Please select at least one file.");
return false;
var filesList = [];
var $fileChecks = $('.fileCheck:checked');
$fileChecks.each(function()
filesList.push($(this).val());
);
alert("You have copied " + filesList.length+ " URL");
copyURL(filesList.join("n"),false);
//function to call the edit the page
function editURL(filename,url)
var x=document.getElementById("table123");
x.style.display="none";
$('body').pWin("open",
x: 260,
y: 47,
height: 450,
width: 881,
title: "Edit:Advance Configuration",
skinMode:'dialog',
iframe:true,
url: "editUrl.jsp",
data:
filename:filename,
link:url
,
offResize:true,
offMove:true,
onTitle:false,
offBottom:true
);
// x.style.display="none";
</script>
<!--Display Checkbox -->
<input type="checkbox" class="fileCheck" id="<%=tally=tally+1%>" value="<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>" />
</td>
<td>
<!--Display No -->
<% counter=counter+1;
out.print(counter);
%>
</td>
<td width="28%">
<!-- Display Filename -->
<%=nd.getNodedesc()%>
</td>
<td width="100%">
<!-- Display Unique URL -->
<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>
<%
fileFacade.insert_url(nd.getNodeid(),"f0="+nd.getNodeid()+"&ts="+hash);
//fileFacade.insert_url(nd.getNodeid(),"syscont url/repository/file/view/viewPDF.jsp?url);
%>
</td>
<td>
<!-- Display EDIT/DEL -->
<input type="button" value="Edit URL" onclick="editURL('<%=nd.getNodedesc()%>','<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>')" >
</td>
<td> <!-- Display COPY feature -->
<input type="button" value="Copy URL" onclick="copyURL('<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>',true)">
</td>
</tr>
</tbody>
<%
%>
<script>
function copyURL(url,showMsg)
var copyText = url;
var el = document.createElement('textarea');
el.value = copyText;
el.setAttribute('readonly', '');
el.style =
position: 'absolute',
left: '-9999px'
;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
if(showMsg==true)
alert("You have copied the URL");
</script>
</table>
<!--Copy button to copy multiple links -->
<div class="wrapper">
<button type="button" onclick="copymultiplelink()"> Copy Selected URL</button>
</div>
</div>
<style>
.wrapper
position: absolute;
top: 90%;
left: 5%;
</style>
</body>
</html>
EDIT:
Full exception trace:
[2019-03-25T13:17:18.792+0800] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1553491038792] [levelValue: 900] [[
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.repository.file.url.editUrl_jsp._jspService(editUrl_jsp.java:349)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
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:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
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:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:722)
]]
[2019-03-25T13:48:44.442+0800] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=185 _ThreadName=ContainerBackgroundProcessor[StandardEngine[glassfish-web].StandardHost[server].StandardContext[]]] [timeMillis: 1553492924442] [levelValue: 800] [[
Session event listener threw exception
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:72)
at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:64)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:771)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:1056)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:6371)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1823)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1812)
at java.lang.Thread.run(Thread.java:722)
]]
jsp
I am trying to call my other JSP page in my current JSP page. Basically in my editUrl.jsp
, I want to include genurl.jsp
as well.
From what I know, the way to do it is either:
<jsp:include page="file.jsp" />
or
<%@ include file="filename" %>
So I followed the method and did it like below:
<%@ include file="genurl.jsp" %>
When I run my program, it throws a nullpointer exception meaning it couldn't locate this file. I checked my root folder and they are both located in the same folder. Here is a screenshot for reference.
Am I doing anything wrong?
My genurl.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../../WEB-INF/jspf/mcre.jspf" %>
<%@include file="../../../WEB-INF/jspf/session.jspf"%>
<%@ page import="com.htasia.panton9.Core.Settings.SettingsFacadeLocal" %>
<%@page import="com.htasia.panton9.Utilities.CoreUtil,
com.htasia.MCRE.File.*,
com.htasia.MCRE.Types.*,
com.htasia.panton9.Core.Node.*,
com.htasia.panton9.Entities.Core.Node,
com.htasia.panton9.Entities.MCRE.*"%>
<%@ page import="javax.persistence.EntityManager" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page import="java.security.SecureRandom" %>
<%@ page import="java.math.BigInteger" %>
<html>
<%
String relPath = "../../../";
NodeFacadeLocal nFacade = null;
InitialContext ntx = new InitialContext();
try
nFacade = (NodeFacadeLocal) ntx.lookup("java:comp/env/node");
catch (NamingException e)
e.printStackTrace();
%>
<head>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win.js"></script>
<script type="text/javascript" src="<%=relPath%>js/jquery/jquery-panton-win-2.js"></script>
<title>Generate URL</title>
</head>
<body>
<div id="table123" style="overflow:scroll;height:400px;width:100%;overflow:auto">
<table class="filesTbl">
<tr>
<th width="1%">
Checkbox
</th>
<th width="1%">
No
</th>
<th width="20%">
File Name
</th>
<th width="50%">
Unique URL
</th>
<th width="1%">
Edit
</th>
<th width="1%">
Copy
</th>
<th width="1%">
Email
</th>
</tr>
<%
//need to input logic to populate data on each row
int counter=0;
int tally=0;
String[] split = request.getParameter("nodeID").split(",",0);
for(int i=0;i<split.length;i++)
long file=Long.parseLong(split[i]);
List files = fileFacade.list_items(file);
for (Iterator rstltr = files.iterator(); rstltr.hasNext();)
Fmedia fv = (Fmedia) rstltr.next();
Node nd = nodeFacade.get(fv.getNodeid(), false);
// Fmedia fm = fileFacade.get_file(fv.getNodeid());
int count = 0;
count++;
long fileid= nd.getNodeid();
SettingsFacadeLocal settingFacade = (SettingsFacadeLocal)ctx.lookup("java:comp/env/settings");
String redirectURL = settingFacade.get("SERVER_URL").getAtval();
//declare a timestamp for unique URL
// String timeStamp=new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new java.util.Date());
// String hash = org.apache.commons.codec.digest.DigestUtils.sha256Hex(timeStamp);
SecureRandom secureRandom=new SecureRandom();
byte[] token = new byte[12];
secureRandom.nextBytes(token);
String hash= new BigInteger(1, token).toString(12);
%>
<tbody>
<tr>
<td width="5%">
<script>
// function to copy multiple URL links
function copymultiplelink()
var selectedFiles = $('.fileCheck:checked');
if(selectedFiles.length < 1 )
alert("Please select at least one file.");
return false;
var filesList = [];
var $fileChecks = $('.fileCheck:checked');
$fileChecks.each(function()
filesList.push($(this).val());
);
alert("You have copied " + filesList.length+ " URL");
copyURL(filesList.join("n"),false);
//function to call the edit the page
function editURL(filename,url)
var x=document.getElementById("table123");
x.style.display="none";
$('body').pWin("open",
x: 260,
y: 47,
height: 450,
width: 881,
title: "Edit:Advance Configuration",
skinMode:'dialog',
iframe:true,
url: "editUrl.jsp",
data:
filename:filename,
link:url
,
offResize:true,
offMove:true,
onTitle:false,
offBottom:true
);
// x.style.display="none";
</script>
<!--Display Checkbox -->
<input type="checkbox" class="fileCheck" id="<%=tally=tally+1%>" value="<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>" />
</td>
<td>
<!--Display No -->
<% counter=counter+1;
out.print(counter);
%>
</td>
<td width="28%">
<!-- Display Filename -->
<%=nd.getNodedesc()%>
</td>
<td width="100%">
<!-- Display Unique URL -->
<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>
<%
fileFacade.insert_url(nd.getNodeid(),"f0="+nd.getNodeid()+"&ts="+hash);
//fileFacade.insert_url(nd.getNodeid(),"syscont url/repository/file/view/viewPDF.jsp?url);
%>
</td>
<td>
<!-- Display EDIT/DEL -->
<input type="button" value="Edit URL" onclick="editURL('<%=nd.getNodedesc()%>','<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>')" >
</td>
<td> <!-- Display COPY feature -->
<input type="button" value="Copy URL" onclick="copyURL('<%=redirectURL+"/repository/file/view/viewPDF.jsp?f0="+nd.getNodeid()+"&ts="+hash%>',true)">
</td>
</tr>
</tbody>
<%
%>
<script>
function copyURL(url,showMsg)
var copyText = url;
var el = document.createElement('textarea');
el.value = copyText;
el.setAttribute('readonly', '');
el.style =
position: 'absolute',
left: '-9999px'
;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
if(showMsg==true)
alert("You have copied the URL");
</script>
</table>
<!--Copy button to copy multiple links -->
<div class="wrapper">
<button type="button" onclick="copymultiplelink()"> Copy Selected URL</button>
</div>
</div>
<style>
.wrapper
position: absolute;
top: 90%;
left: 5%;
</style>
</body>
</html>
EDIT:
Full exception trace:
[2019-03-25T13:17:18.792+0800] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1553491038792] [levelValue: 900] [[
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.repository.file.url.editUrl_jsp._jspService(editUrl_jsp.java:349)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
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:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
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:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:722)
]]
[2019-03-25T13:48:44.442+0800] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=185 _ThreadName=ContainerBackgroundProcessor[StandardEngine[glassfish-web].StandardHost[server].StandardContext[]]] [timeMillis: 1553492924442] [levelValue: 800] [[
Session event listener threw exception
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:72)
at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:64)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:771)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:1056)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:6371)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1823)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1812)
at java.lang.Thread.run(Thread.java:722)
]]
jsp
jsp
edited Mar 25 at 7:28
Daredevil
asked Mar 25 at 5:02
DaredevilDaredevil
52413
52413
Edited my post pls help
– Daredevil
Mar 25 at 6:42
The code in file "genurl.jsp" bothers you. Post the code if available.
– adatapost
Mar 25 at 7:20
Yea because if I removed it,it works.
– Daredevil
Mar 25 at 7:27
Edited my post, it might be appear a bit long but it's better to post it
– Daredevil
Mar 25 at 7:29
It is throwing NPE, means in your jsp java code is throwing NPE. While importing it, it is throwing so no problem with your import. Problem with your genurl.jsp file. Add not null condition if required.
– Sudhakar
Mar 25 at 13:24
|
show 1 more comment
Edited my post pls help
– Daredevil
Mar 25 at 6:42
The code in file "genurl.jsp" bothers you. Post the code if available.
– adatapost
Mar 25 at 7:20
Yea because if I removed it,it works.
– Daredevil
Mar 25 at 7:27
Edited my post, it might be appear a bit long but it's better to post it
– Daredevil
Mar 25 at 7:29
It is throwing NPE, means in your jsp java code is throwing NPE. While importing it, it is throwing so no problem with your import. Problem with your genurl.jsp file. Add not null condition if required.
– Sudhakar
Mar 25 at 13:24
Edited my post pls help
– Daredevil
Mar 25 at 6:42
Edited my post pls help
– Daredevil
Mar 25 at 6:42
The code in file "genurl.jsp" bothers you. Post the code if available.
– adatapost
Mar 25 at 7:20
The code in file "genurl.jsp" bothers you. Post the code if available.
– adatapost
Mar 25 at 7:20
Yea because if I removed it,it works.
– Daredevil
Mar 25 at 7:27
Yea because if I removed it,it works.
– Daredevil
Mar 25 at 7:27
Edited my post, it might be appear a bit long but it's better to post it
– Daredevil
Mar 25 at 7:29
Edited my post, it might be appear a bit long but it's better to post it
– Daredevil
Mar 25 at 7:29
It is throwing NPE, means in your jsp java code is throwing NPE. While importing it, it is throwing so no problem with your import. Problem with your genurl.jsp file. Add not null condition if required.
– Sudhakar
Mar 25 at 13:24
It is throwing NPE, means in your jsp java code is throwing NPE. While importing it, it is throwing so no problem with your import. Problem with your genurl.jsp file. Add not null condition if required.
– Sudhakar
Mar 25 at 13:24
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331503%2fjsp-cannot-import-another-jsp-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331503%2fjsp-cannot-import-another-jsp-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Edited my post pls help
– Daredevil
Mar 25 at 6:42
The code in file "genurl.jsp" bothers you. Post the code if available.
– adatapost
Mar 25 at 7:20
Yea because if I removed it,it works.
– Daredevil
Mar 25 at 7:27
Edited my post, it might be appear a bit long but it's better to post it
– Daredevil
Mar 25 at 7:29
It is throwing NPE, means in your jsp java code is throwing NPE. While importing it, it is throwing so no problem with your import. Problem with your genurl.jsp file. Add not null condition if required.
– Sudhakar
Mar 25 at 13:24