[Beginner's Corner] - Deploying Simple Servlet
by dontocsata
Hello all, I am new to Java Enterprise, Servlets, and JBoss (learning for a job).
I jave jboss 4.2.3, running up fine.
I have a simple HelloWorld Servlet (code below). How do I deploy this on jBoss? I made a folder WEB-INF with a web.xml containing:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http:/java.sun.com/dtd/web-app_2_3.dtd">
| <servlet>
| <servlet-name>hello</servlet-name>
| <servlet-class>test.HelloServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>hello</servlet-name>
| <url-pattern>/hello</url-pattern>
| </servlet-mapping>
| </web-app>
I put my web-inf folder into the deploy folder and it fails to deploy it, it says the state for each file is 'INIT_WAITING_DEPLOYER'.
How do I actually get this servlet to run?
Folder Structure:
WEB-INF/web.xml
WEB-INF/classes/test/HelloServlet.class
CODE:
package test;
|
| import java.io.*;
|
| import javax.servlet.http.*;
| import javax.servlet.*;
|
| public class HelloServlet extends HttpServlet {
| public void doGet (HttpServletRequest req,
| HttpServletResponse res)
| throws ServletException, IOException
| {
| PrintWriter out = res.getWriter();
|
| out.println("Hello, world!");
| out.close();
| }
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252462#4252462
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252462
15 years, 2 months
[jBPM Users] - Issue on Starting jBPM from External Client.
by contactnagesh
Hi,
I am trying to invoke process from the External Client as Servlet.
I have the below code
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
System.out.println("###Starting from the jBPM"+jbpmConfiguration);
jbpmContext = jbpmConfiguration.createJbpmContext();
System.out.println("###Starting from the jBPM"+jbpmContext);
processInstance = jbpmContext.newProcessInstance("websale");
System.out.println("###processInstance"+processInstance);
//contextInstance = processInstance.getContextInstance();
//contextInstance.setVariable("var", "abc");
processInstance.getRootToken().signal();
In place of the First line, I have tried in various options
/JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseResource("org/jbpm/default.jbpm.cfg.xml");.
Either way I could not suceed the execution. I am hitting the below error.
2:02:57,727 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@185b723
java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:227)
at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:537)
at org.jbpm.JbpmContext.newProcessInstance(JbpmContext.java:370)
at first.Welcome.doGet(Welcome.java:104)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
Can anyone Help me to solve the above issue.
Thanks
Nag
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252435#4252435
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252435
15 years, 2 months