failed to run wicket examples on tomcat7 - netbeans

I downloaded wicket examples 1.6.0 and built successfully in netbeans7.2. but got errors when I tried to deploy on tomcat 7:
Cannot deploy the module. The context.xml file seems to be broken. Check whether it is well-formed and valid.
The module has not been deployed.
See the server log for details.
at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
at
org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:178)
at
org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:130)
at
org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:212)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
heres the contents in context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<!-- <Loader className="org.atmosphere.util.AtmosphereClassloader"/> -->
<Loader delegate="true"/>
</Context>

I prefer to run wicket in eclipse as it negates the requirement to mess around with an external tomcat instance.
If you are comfortable with eclipse and maven i would download wicket 1.6 example archetype via maven, import into eclipse and then in the test directory you can run the run.java class to get an internal jetty server host wicket for you.
this should get you started quickly without having to wrestle with tomcat configurations too.
Not really an answer but an alternative route to the same end point

Add parameter path to context tag, same path that app will be served:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/application-path-name/">
<!-- <Loader className="org.atmosphere.util.AtmosphereClassloader"/> -->
<Loader delegate="true"/>
</Context>
Answer obtained from this question.

Related

No show anymore message of publisher Java Web Start

I have developed an application via Java Web Start more or less according to this: How do I fix "missing Codebase, Permissions, and Application-Name manifest attribute" in my JNLP app? I have packed the jar with manifest.txt, etc..but in this way I have resolved missing attributes problem, and now I have other problem this message is always showed!! I checked "No show again" and each time I press button to execute and always is showed!! I
Adicionally this is my manifest file:
Manifest-Version: 1.0
Class-Path: .
Main-Class: com.zkteco.biometric.AccesoBiometrioAS2
Permissions: all-permissions
Codebase: http://192.168.111.25:8180/pos-web/
Application-Name: Biometrico
And my Jnlp File this:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://192.168.111.25:8180/pos-web/">
<information> <title>CajaPos</title> <vendor>xxx</vendor>
</information>
<security><all-permissions/>
</security>
<resources>
<j2se version="1.2+"/>
<jar href="xx.jar"
main="true" />
</resources
<application-desc main-class="ec.com.xx.pos" type="JavaFX">
<argument>XY</argument>
</application-desc>
</jnlp>
In this page after check the dialog is not showed again and works fine.
https://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html
Where XY change for each request because I generate jnlp-xml in a dynamically way with a servlet.
This is due to your Java settings. It is a security prompt. There’s nothing you can change in your application to prevent this dialog, it is up to the end-user to change their security settings to show/hide these dialog windows.
Edit: I also recommend migrating your app to a different delivery platform because Java Web Start is being violently turned off by Oracle.

How to define Context Path in Wildfly?

I've used the following code to set the Context Path in tomcat where I can access my application directly using localhost:8080 by overriding the tomcat's default path.
<Context path="" docBase="G:\bitbucket\projectpath\project\build\libs\project-1.0" workDir="G:\bitbucket\projectpath\project\build\libs\project-1.0\work" debug="0" reloadable="false" autoDeploy="true" unpackWARs="true" crossContext="true"/>
Now I'm going to use wildfly-8.2.0 as runtime environment. I tried by directly pasting the .war file into G:\wildfly-8.2.0.Final\standalone\deployments and I can access my project in browser like localhost:8080/project-1.0.
I need to setup the same configuration to wildfly like I've done in tomcat to access my project in localhost:8080 by overriding the wildfly's default welcome page. I tried to do the same in wildfly but I'm stuck where to do that. There are lot of .xml files in wildfly folder (when comparing with tomcat's simple server.xml file) which I get confused on where to start with. I searched using "How to set Context Path in Wildfly", but got no success. Can anyone help me on how to do it..? If it's related to coding, then I can do lot of searches and atleast I can get some Ideas, but I'm stuck here at configuration. Thanks in Advance.
You can do this in the by adding a /WEB-INF/jboss-web.xml file in the application that you deploy:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/</context-root>
</jboss-web>
Change context-root directly in WebService class with annotation.
import org.jboss.ws.api.annotation.WebContext;
#Stateless
#WebService(portName = "SampleWSPort", serviceName = "SampleWS")
#SOAPBinding(style = Style.DOCUMENT)
#WebContext(contextRoot = "/SWS", urlPattern = "/SampleWS")
public class SampleWS implements SampleWSInterface {
org.jboss.ws.api.annotation.WebContext is in MAVEN artifact:
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-api</artifactId>
<version>1.1.2.Final</version>
</dependency>

Liferay - Eclipse alloy tag library error

I am developing a portlet that runs on Liferay portal (I have currently Liferay+Tomcat7 bundle, it will later run on JBoss). I am using Eclipse Helios with Liferay IDE and Liferay SDK.
In my .jsp files, I use Alloy:
<%# taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
Everything works fine - the portlet gets successfully deployed and is shown correctly.
The only problem is, that Eclipse is marking it as an error:
Description Resource Path Location Type
Can not find the tag library descriptor for "http://liferay.com/tld/aui" edit.jsp /PortletVisual-portlet/docroot line 2 JSP Problem
This is mainly a cosmetic error. Liferay IDE in Eclipse evidently doesnt understand these dependencies, although the project itself works fine. I can live with this "error marker", it doesnt bother me that much. I was just curious if there is a way to fix it.
Thanks for any tips!
EDIT: this is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>PortletVisual-portlet</display-name>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://liferay.com/tld/aui</taglib-uri>
<taglib-location>/WEB-INF/tld/aui.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
Try this one:
<taglib>
<taglib-uri>http://liferay.com/tld/aui</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-aui.tld</taglib-location>
</taglib>
If not working try here
Hope I helped! Good luck!!!!

How can I deploy a web app with sbt 0.11?

it seems that both the jetty-run and jetty commands are missing from SBT 0.11. Either that or I am doing something very wrong. I am simply running sbt, then trying to run jetty-run. I have defined a web.xml file in src/main/webapp/WEB-INF/web.xml which contains the following information:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"> </web-app>
I am simply trying to deploy a blank web-app using the latest SBT. I cannot find any documentation or updated examples for doing so. Any ideas?
Thank you in advance.
Starting from sbt 0.8 (xsbt branch), if I remember correctly, web support goes as a standalone plugin. Here you can find instructions on how to install and use it. In general, this new plugin fully supports the regular workflow of a legacy SBT (e.g., jetty-run, jetty-reload, etc.).

Deploying my GWT Application on Tomcat Server

I want to setup a GWT application (Version 2.0.0) with many dependencys in my local Tomcat Server. I started to write a maven2 build script for deploying and packaging of the application.
I wrote a maven2 script which works really fine in my eyes, but I get an error when trying to deploy the out coming war on my tomcat.
2011-04-21 18:14:13,951 ERROR org.apache.catalina.startup.ContextConfig - Parse error in application web.xml file at jndi:/localhost/quickfinder.ui-1.0-SNAPSHOT/WEB-INF/web.xml
org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.
The web.xml is look like the following:
here and my maven2 script looks like this:
here
After compiling and linking and the other stuff my "deploy" directory (named war) looks like:
|-AnswerPanel.css
|-common.css
|-DomainListPanel.css
|-glossary.css
|-glossary.html
|-images
|-META-INF
|-MulitpleChoiceEditPanel.css
|-MultipleChoiceDisclosurePanel.css
|-NaviPanel.css
|-QuestionnairePanel.css
|-quickfinder
|-Quickfinder.css
|-Quickfinder.html
|-quickfinderportlet
|-QuickfinderPortlet.html
|-styles-css2.css
|-styles-css3.css
|-WEB-INF
|--lib
Under lib in the WEB-INF directory, all needed library's are available. The Project has got some RPC calls and so on.
With mvn compile war:war a .war file and a folder named #artifactId#-SNAPSHOT-1.00 are created under /target.
I don't know how to handle with this error form tomcat, or is there a logical mistake in the pom.xml.
BR,
mybecks
Your web.xml is not well-formed: fix the below section
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" [
<!ENTITY GlossaryWebXml SYSTEM "glossary.web.xml"> -->
]>
I would suggest to add maven-xml-plugin to your validate phase. It will check your web.xml automatically.