Re: Apache Webserver (2.x) with JBoss 4.0. Let Apache serve the static content while JBoss is the J2EE Container
by samkï¼ twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=4 Posted on behalf of a User
Hi,
i'm having problems deploying the web app using the article.
i've done all the changes suggested and also from another article it states to edit out the <!-- A HTTP/1.1 Connector on port 8080 -->
element section and leave it as <!-- A AJP 1.3 Connector on port 8009 -->
my question is where do i deploy the web app. i have it currently configured in a directory for Apache to serve as an exploded .war contents , do i also need to place the .war file in deploy folder of Jboss. this is only for a single machine single jboss instance setup.
i'm acessing it as http://localhost/myapp from the apache configuration do i need to put the port 8009 which is where the jboss AJP 1.3 connector is available?
please can you inform me how a webapp is run using the apache / jboss config?
In Response To:
Download the connector from <a href=http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win3...>
the Apachie download site. Select mod_jk-apache-2.0.55.so for Apache 2.0, and it works with Apache 2.0.50
and later (Remember to get the latest version. Directives like JkMountFile donÂ’t work with older versions
and this will save you a lot of grief). This binary has to be renamed to mod_jk.so and placed in your
modules directory. If you used the default installation of Apache, this directory is C:\Program Files\Apache
Group\Apache2\modules. Now we need to tell Apache about JBoss/Tomcat container. You should create a file
called mod-jk.conf in the Apache conf directory (C:\Program Files\Apache Group\Apache2\conf) and include
it into the httpd.conf directory. Alternately you could add this directly into httpd.conf file but to
include mod-jk.conf is the acceptable and preferred way. Do this by adding the following lines at the
end of the httpd.conf file:
# Include mod_jk configuration file
Include conf/mod-jk.conf
The content of mod-jk.conf:
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
JkMount /application/* loadbalancer
# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
JkMountFile conf/uriworkermap.properties
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm
# Add jkstatus for managing runtime data
<Location /jkstatus/>
JkMount status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
Now a workers.properties file needs to be created in the conf directory to tell Apachie where the servlet
container (JBoss/Tomcat) is. Here are the contents of a typical file:
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=host1.mydomain.com
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.local_worker=1 (1)
worker.node1.cachesize=10
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host= host2.mydomain.com
worker.node2.type=ajp13
worker.node2.lbfactor=1
#worker.node2.local_worker=1 (1)
worker.node2.cachesize=10
# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
#worker.loadbalancer.local_worker_only=1
#worker.list=loadbalancer
# Status worker for managing load balancer
worker.status.type=status
Change host1 and host2 to the DNS name or IP address of the server (or servers) that the servlet container
is installed on. For load balancing and other detailed information look at the mod-jk documentation the
Apache website. This should work out of the box if you just change host1 and host2.
Now create uriworkermap.properties in the conf directory and populate is as follows:
# Simple worker configuration file
#
# Mount the Servlet context to the ajp13 worker
/jmx-console=loadbalancer
/jmx-console/*=loadbalancer
/web-console=loadbalancer
/web-console/*=loadbalancer
The above tells Apache to forward requests /jmx-console and /web-console to JBoss. Add your own context
references that you want forwarded to JBoss in this file.
Finally a couple of changes in the JBoss configuration: Make the changes in your model/engine, i.e.,
all/default/minimal.
1. In C:\Program Files\jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml
set the following attribute to true from false. This will allow sessions cookies to include the jvmroute
attribute in cookies
<attribute name="UseJK">true</attribute>
2. In C:\Program Files\jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar\server.xml add the jvmroute
attribute as shown . Make sure host1 is the same host/node that you used in workers.properties.
<Engine name="jboss.web" defaultHost="localhost" vmRoute="host1">
Now restart the Apache Webserver and JBoss and you should be in business.
18Â years, 8Â months
[JBoss Seam] - Using s:convertEntity with Hibernate and no EJB
by jcelanoï¼ netkey.com
I am using Seam 2.0 CR2 with Jboss 4.2. Our application is a simple web application that is deployed as a WAR file and uses Hibernate for persistence. My questions are:
1. Can i use the s:convertEntity tag if i am using simple Hibernate for my persistence in a WAR file (i.e. no EJB stuff)?
2. If so, how? Or where is a good example of this? Or where is this documented?
I have tried to follow the directions in the PDF documentation (sections 8.2 and the tag reference), but i get the following exception, when i access the web page.
java.lang.ClassCastException: org.jboss.seam.persistence.HibernateSessionProxy cannot be cast to javax.persistence.EntityManager
My components.xml file snippet looks like this:
<persistence:hibernate-session-factory name="hibernateSessionFactory"/>
|
| <persistence:managed-hibernate-session name="netkeySession"
| session-factory="#{hibernateSessionFactory}" auto-create="true"/>
|
| <transaction:hibernate-transaction session="#{netkeySession}"/>
|
| <component name="org.jboss.seam.ui.EntityConverter">
| <property name="entityManager">#{netkeySession}</property>
| </component>
I am pretty sure that the EntityConverter component is not correct, b/c the HibernateSession cannot be the entityManager, but i couldn't figure out what to put there instead.
Any help or pointers would be greatly appreciated,
thx
Joe C
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098304#4098304
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098304
18Â years, 8Â months
[EJB/JBoss] - Problem with transaction
by argonist
Hello,
Two methodes from plain java class should access into requetBean to fetch/store the data into/from db. At the transaction issue, the second methode "findUserGroup" cannot be called, because it are already in the active transaction. Have you an idea to solve that problem?
Error message:
anonymous wrote :
| "Caused by: java.lang.reflect.UndeclaredThrowableException
| at $Proxy407.createRawRequest(Unknown Source)
| at de.kirchedlau.ponte.utils.convertExceltoDB.sheetToRawRequest(convertExceltoDB.java :121)
| at de.kirchedlau.ponte.utils.convertExceltoDB.sheetToEntity(convertExceltoDB.java:102)
| ...
| ...
|
| Caused by: java.io.NotSerializableException: de.kirchedlau.ponte.ejb.entities.admin.UserGroup
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
| ...
| ...
| ...
|
| // methode is called
| private void sheetToRawRequest(Sheet sheet) {
| RequestInterface requestSession = (RequestInterface) sessionhandler.requestSession;// adresse of RequestBean
|
| if (requestSession == null) {
| System.out.println("RequestInterface authsession does not exist");
| return;
| }
| requestSession.deleteAllRawRequests(); // Access to methode of bean
|
| for (int i = 0; i < sheet.getRows(); i++) {
|
| Cell[] row = sheet.getRow(i);
| RawRequest request = rowToRawRequest(row); // that methode is called and more above
| if (request != null) {
| requestSession.createRawRequest(request); // Accessing the methode of requestBean
| System.out.println("RawRequest added: " + request.getAbout());
| } else {
| System.out.println("Error in line " + i);
| }
| }
| }
|
| private RawRequest rowToRawRequest(Cell[] row)
| {
| RawRequest request = new RawRequest();
| ...
| ...
| ...
|
| // Column 12: Group
| if(numOfColumns > 11){
| UserGroup userGroup = requestsession.findDefaultUserGroup(); // Access to RequestBean. That is problem
| request.setUserGroup(userGroup); // Es definiert auch in der RequestInterface
| }
| return request;
| }
|
Thank you in advance
Manu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098298#4098298
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098298
18Â years, 8Â months
[JBossWS] - Re: Exception while deploying the webservice using jax-ws
by tpawankumar
Hi,
This issue has been resolved by moving to Jbossws 2.0.1 GA.
Now i am getting different exception
java.lang.IllegalStateException: Cannot find endpoint meta data for: MacafeeAdapter
at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.getEndpointM
etaData(UnifiedMetaDataDeploymentAspect.java:117)
at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.create(Unifi
edMetaDataDeploymentAspect.java:86)
at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy
(DeploymentAspectManagerImpl.java:115)
at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDep
loyerHook.java:97)
at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInt
erceptor.java:90)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.
start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterce
ptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
18:29:00,849 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@f00a09d9 { url=file:/D:/jboss-4.2.1.GA/serve
r/default/deploy/mcafeeAdapter.war }
deployer: MBeanProxyExt[jboss.web:service=WebServer]
status: Deployment FAILED reason: Cannot find endpoint meta data for: MacafeeA
dapter
state: FAILED
watch: file:/D:/jboss-4.2.1.GA/server/default/deploy/mcafeeAdapter.war
altDD: null
lastDeployed: 1193230739941
lastModified: 1193230739925
mbeans:
jboss.web:j2eeType=Servlet,name=default,WebModule=//localhost/mcafeeAdapter,
J2EEApplication=none,J2EEServer=none (state not available)
jboss.web:j2eeType=Servlet,name=MacafeeAdapter,WebModule=//localhost/mcafeeA
dapter,J2EEApplication=none,J2EEServer=none (state not available)
jboss.web:j2eeType=Servlet,name=jsp,WebModule=//localhost/mcafeeAdapter,J2EE
Application=none,J2EEServer=none (state not available)
This is my remote interface
import javax.xml.ws.ResponseWrapper;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
* JBossWS Generated Source
*
* Generation Date: Tue Oct 23 09:29:51 IST 2007
*
* This generated source code represents a derivative work of the input to
* the generator that produced it. Consult the input for the copyright and
* terms of use that apply to this source code.
*
* JAX-WS Version: 2.0
*
*/
@WebService(name = "VendorOrderPort", targetNamespace = "http://smo.xsd.covad.com/vendororder")
public interface VendorOrderPort extends Remote{
/**
*
* @param vendorOrder
* @return
* returns com.covad.xsd.smo.vendororder.VendorOrder
* @throws RemoteException
*/
@WebMethod
@WebResult(targetNamespace = "http://smo.xsd.covad.com/vendororder")
@RequestWrapper(localName = "processVendorOrder", targetNamespace = "http://smo.xsd.covad.com/vendororder", className = "com.covad.xsd.smo.vendororder.ProcessVendorOrder")
@ResponseWrapper(localName = "processVendorOrderResponse", targetNamespace = "http://smo.xsd.covad.com/vendororder", className = "com.covad.xsd.smo.vendororder.ProcessVendorOrderResponse")
public VendorOrder processVendorOrder(
@WebParam(name = "vendorOrder", targetNamespace = "http://smo.xsd.covad.com/vendororder")
VendorOrder vendorOrder)
throws RemoteException
;
}
This is Web service implementation class
package com.covad.mcafee.adapter.webservice;
import com.covad.mcafee.service.McAfeeProxy;
import com.covad.xsd.smo.vendororder.VendorOrder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.covad.xsd.smo.vendororder.VendorOrderPort;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@WebService(endpointInterface="com.covad.xsd.smo.vendororder.VendorOrderPort")
public class macafeeAdapter implements VendorOrderPort {
private static Log logger = LogFactory.getLog("com.covad.mcafee.adapter");
@WebMethod(operationName = "ProcessVendorOrder")
public VendorOrder processVendorOrder(VendorOrder vendorOrder) {
// logger.info("Entering mcafeeadapter.processVendorOrder() with "+vendorOrder.xmlText());
logger.info("Entering mcafeeadapter.processVendorOrder() with ");
McAfeeProxy mcAfeeProxy = new McAfeeProxy();
VendorOrder res = mcAfeeProxy.processVendorOrder(vendorOrder);
logger.info("COMPLETE");
return res;
}
}
Please help me.
Thanks in Advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098293#4098293
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098293
18Â years, 8Â months