I am using Eclipse Indigo with runjettyrun plugin (latest). The webapp deploys successfully, but on non-trivial page I get a JSP custom tag compilation error.
I am getting the following JSP compilation error:
java.lang.IllegalStateException: STREAM
at org.eclipse.jetty.server.Response.getWriter(Response.java:683)
I want to look at the java file that got created from the Tag file. In the stacktrace, I can see that the Tag is being compiled to a file name:
xyz_Tag.java
I would like to view this java file. Any idea where I can find it?
you can instruct Jetty to keep generated java source files. There are many ways to configure this. Easiest way to do it is passing init parameter keepgenerated as true for org.apache.jasper.servlet.JspServlet in web.xml.
<init-param>
<param-name>keepgenerated</param-name>
<param-value>>true</param-value>
</init-param>
More details you can find in: http://wiki.eclipse.org/Jetty/Howto/Configure_JSP
Related
I have been trying to debug JSP files (with awful lots of Java code) using the following configuration:
<wls:jsp-descriptor>
<wls:keepgenerated>true</wls:keepgenerated>
<wls:precompile>false</wls:precompile>
<wls:debug>true</wls:debug>
<wls:verbose>true</wls:verbose>
<wls:print-nulls>false</wls:print-nulls>
</wls:jsp-descriptor>
But every time I set a breakpoint in the file I am unable to see the source of the JSP.
I am using Spring Toolsuite and Weblogic 11gR1 (10.3.6). Other than the same configuration for other applications, this is a brand new installation of both.
How can I configure Eclipse to search for the JSP files to debug?
You can precompile the complete war file with: weblogic.appc
or only JSPs with: weblogic.jspc
more details at:
http://devwebcl.blogspot.cl/2014/09/wls-precompile-earwar-ejbjsp.html
java weblogic.jspc -forceGeneration -keepgenerated -verboseJspc -d d:\tmp\export\ -classpath .;D:\proj\webapp-wl-v4\web\WEB-INF\classes;D:\proj\webapp-wl-v4\foo.jar;D:\proj\webapp-wl-v4\lib\bar.jar index.jsp
I have a JSF / PrimeFaces project that I had deployed on a GlassFish 3.1.2.2 Server. It uses my own theme and until now worked without problems. However today I wanted to deploy it on a GlassFish 4.1 Server and now I am getting this error:
java.lang.IllegalArgumentException: Path resources/primefaces-mytheme does not start with '/'
There is quite a lot more:
at org.apache.catalina.core.StandardContext.getResourcePaths(StandardContext.java:7577)
at org.apache.catalina.core.ApplicationContext.getResourcePaths(ApplicationContext.java:443)
at org.apache.catalina.core.ApplicationContextFacade.getResourcePaths(ApplicationContextFacade.java:239)
at com.sun.faces.context.ExternalContextImpl.getResourcePaths(ExternalContextImpl.java:532)
at com.sun.faces.application.resource.WebappResourceHelper.findLibrary(WebappResourceHelper.java:189)
at com.sun.faces.application.resource.ResourceManager.findLibrary(ResourceManager.java:465)
at com.sun.faces.application.resource.ResourceManager.getResourceInfo(ResourceManager.java:292)
at com.sun.faces.application.resource.ResourceManager.doLookup(ResourceManager.java:286)
(...)
But it's all just gibberish to me, nowhere I can see any class or file I created, so I can't put my finger on it where the error comes from. All I know is that it must be related to my theme, which is (unpacked -> I don't use a jar) under the /resources/primefaces-mytheme folder:
webapp
+-WEB-INF
+-resources
+-default
+-images
+-primefaces-mytheme
+-images
+-theme.css
Within the theme.css the reference to images in the resource folder is like this:
url("#{resource['primefaces-mytheme:images/ui-bg_flat_0_ffffff_40x100.png']}")
The css file is actually the only place where I write out the name of my theme primefaces-mytheme. Where do I have to look for the reason of my error?
Found it. I thought it had something to do on how I use the resource folder and how I reference it, but it was actually right there before my eyes: in the deployment descriptor web.xml where the resources directory is declared:
GlassFish 3.1.2.2 accepted this:
<context-param>
<param-name>javax.faces.WEBAPP_RESOURCES_DIRECTORY</param-name>
<param-value>resources</param-value>
</context-param>
GlassFish 4 needs this: (/ before resources)
<context-param>
<param-name>javax.faces.WEBAPP_RESOURCES_DIRECTORY</param-name>
<param-value>/resources</param-value>
</context-param>
I don't know why the earlier GlassFish version accepted the param-value without leading /. Maybe I had it all wrong from the beginning and GlassFish 3 kindly ignored my typo or maybe they just changed the way a directory needs to be declared.
I have a smart GWT app example called AwesomesmartGWTUIProject from
javacodegeeks
Its package is com.javacodegeeks.smartgwt.appui
In eclipse when i try to run it as a web application I get the following error
In order for your application to run correctly, you will need to include these tags in your host page directly. In order to avoid this error, you will need to remove the script tags from the gwt.xml file, or add this property to the gwt.xml file: <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
[ERROR] shell failed in doSlowStartup method
Mar 31, 2014 10:07:41 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /awesomesmartgwtuiproject/com.javacodegeek.smartgwt.appui.awesomesmartgwtuiproject.nocache.js
It simply doesn't display anything when I try to run it in my browser. Am new to smartGwt so am not so conversant with the configurations. Any ideas ?
Have you compiled your GWT project?
Is there nocache.js file generated in your project at correct location?
You have to read about Understanding the GWT Compiler.
Every thing is defined at above link including project structure, GWT compilation etc.
Use rename-to attribute in your module gwt.xml file.
Directly from the above link:
You may have noticed that one of the generated files is named after your module, followed by a .nocache.js suffix. This is the GWT bootstrap file. Similar to the output subdirectory war/, the name of this file is also controlled by the rename-to attribute in your module XML file.
I m new in Struts2. Creating a hello world program using struts. When I run it got first screen where i put my input but when click on submit button giving following error.
Source of this helloworld example: http://www.tutorialspoint.com/struts_2/index.htm
HTTP Status 404 - /HelloWorldStruts2/hello
type Status report
message /HelloWorldStruts2/hello
description The requested resource (/HelloWorldStruts2/hello) is not available.
Apache Tomcat/6.0.29
Suggest what is the issue?
Got the solution.
In index.jsp there was <form> tag. When I changed it to <s:form> its working fine.
Or change from
<form action="hello">
to
<form action="hello.action">
This is what worked for me, specific to the question. Tomcat 8 was used:
Make sure you have created the classes folder under WebContent\WEB-INF.
In that create the logging.properties file and add the following content to it. (It doesn't matter if the file jumps on its own to Java Resources > Libraries) :-
org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = \ java.util.logging.ConsoleHandler
Then in the location of Tomcat's webapps folder delete your HelloWorldStruts2.war file.
Now follow the site's instructions to Export your project to a new HelloWorldStruts2.war file (remember to overwrite the existing .war file with the same name if it's there).
Again, deploy this file by copying it to your Tomcat directory's webapps folder.
In the browser, go to http://localhost:8080/HelloWorldStruts2/index.jsp again, though I'm not sure it will work for sure this time.
But this time, watch the Tomcat server application's verbose output. You will get some kind of exception like this (leave out Warnings for now):
30-Mar-2014 17:39:29.273 SEVERE [localhost-startStop-7] org.apache.catalina.core.StandardContext.filterStart Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:213)
at org.apache.struts2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:102)
...
Seeing this, what I did immediately was copy the commons-lang3-x.y.z.jar to the WebContent\WEB-INF\lib folder, and then exported and deployed the project again.
This time, again the page wasn't showing, so I watched the logs and found out that Tomcat did not explicitly clear the contents of the webapps\HelloWorldStruts2 folder.
After deleting both HelloWorldStruts2 and HelloWorldStruts2.war and refreshing the index.jsp page in the browser, my project did work fine!
I would like to add the BIRT reporting engine to an existing webapp in Tomcat. I don't need the BIRT viewer, I really only want to be able to run the reports from a url like http://localhost:8080/birt/output?__report=test.rptdesign&sample=my+parameter and use the different export options pdf, xls, doc, html.
The integration guides I've found so far all include the viewer and writing my own servlets to handle different formats.
I was hoping someone knew simply which servlet mappings from the report-engine web.xml file I needed and which jars I would need to include from the lib directory for this barebones BIRT implementation in existing webapp.
I was hoping someone knew simply which servlet mappings from the
report-engine web.xml file I needed and which jars I would need to
include from the lib directory for this barebones BIRT implementation
in existing webapp.
I didn't necessarily want to write my own servlet I just wanted to integrate the existing reporting runtime from its own standalone webapp (here under the "runtime" button) into my existing webapp, so that I don't have to distribute 2 webapps to support running BIRT reports. Sorry if that wasn't clearer.
I did work this out though, in the simplest possible fashion, in case anyone has a similar question (using BIRT runtime 3.7.1):
All you need is the following servlet mapping added to your own webapp\web-inf\web.xml file:
<!-- Engine Servlet -->
<servlet>
<servlet-name>EngineServlet</servlet-name>
<servlet-class>org.eclipse.birt.report.servlet.BirtEngineServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>EngineServlet</servlet-name>
<url-pattern>/output</url-pattern>
</servlet-mapping>
Include all jars from the web-inf\lib directory of the runtime into your own webapp\web-inf\lib directory.
You can then run .rptdesign files using the output BIRT report url from your own webapp, and specifying whatever format you want, e.g.:
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=pdf
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=html
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=xls
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=doc
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=ppt
As i understand you, you are trying to generate a birt report form a servlet where you have the *.rptdesign in somewhere location.
Good, look at the following code
this.bundle = ResourceBundle.getBundle("com.tts.mersal.resources.MersalResources");
this.config = new EngineConfig();
this.config.setEngineHome(bundle.getString("BIRT_ENGINE_HOME"));
this.config.setLogConfig(bundle.getString("BIRT_LOGGING_FOLDER_PATH"), Level.ALL);
Platform.startup(config);
this.factory = (IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
this.engine = factory.createReportEngine( config );
this.engine.changeLogLevel(Level.ALL);
ContentReader contentReader = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getFileFolderService().getReader(MersalOutboundReportDialogBean.this.dialogReportNode.getNodeRef());
IReportRunnable report = MersalOutboundReportDialogBean.this.getEngine().openReportDesign(contentReader.getContentInputStream());
ReportDesignHandle designHandle = (ReportDesignHandle)report.getDesignHandle();
OdaDataSource source = (OdaDataSource)designHandle.getModule().findDataSource(DATA_SOURCE_NAME);
source.setProperty(source.getPropertyDefn("FILELIST"), buildUrl((String)source.getProperty(designHandle.getModule(), "FILELIST")));
IRunAndRenderTask runAndRenderTask = MersalOutboundReportDialogBean.this.getEngine().createRunAndRenderTask(report);
HTMLRenderOption render = new HTMLRenderOption();
render.setOutputFileName("G:/Render.html");
render.setOutputFormat("html");
runAndRenderTask.setRenderOption(render);
runAndRenderTask.run();
runAndRenderTask.close();
As you can see the first thing you must prepare the birt engine and then get an instance of report from type IReportRunnable, so you can after that set the location of the output by using therender option which will be changed based on your request.
You have multiple chocies, HTMLRenderOption, PDFRenderOption and others.
I hope that will serve you.
Thanks.