[JBoss AS7 Development] - Re: Load on startup is ignored - JaxWS webservice is always initialized first
by Jim Ma
Jim Ma [http://community.jboss.org/people/jim.ma] created the discussion
"Re: Load on startup is ignored - JaxWS webservice is always initialized first"
To view the discussion, visit: http://community.jboss.org/message/617278#617278
--------------------------------------------------------------
> * Why is the ServletContextListener called when all Servlets are instantiated?
>
You probably misundertood by the following webservice deployer output:
> 12:13:26,227 INFO [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-2) Add Service
> id=HelloServlet
> address= http://localhost:8080/helloServlet/HelloServlet http://localhost:8080/helloServlet/HelloServlet
> implementor=servlet.hello.helloservlet.HelloServletImpl
> invoker=org.jboss.wsf.stack.cxf.InvokerJSE
> serviceName={ http://helloservlet.hello.servlet/ http://helloservlet.hello.servlet/}HelloServletImplService
> portName={ http://helloservlet.hello.servlet/ http://helloservlet.hello.servlet/}HelloServletImplPort
> wsdlLocation=null
> mtomEnabled=false
> 12:13:26,228 INFO [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-2) register: jboss.ws:context=helloServlet,endpoint=HelloServlet
> 12:13:29,986 INFO [stdout] (MSC service thread 1-2) HelloServlet is instantiated!
> 12:13:29,991 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service { http://helloservlet.hello.servlet/ http://helloservlet.hello.servlet/}HelloServletImplService from class servlet.hello.helloservlet.HelloServlet
> 12:13:30,023 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-2) Setting the server's publish address to be http://localhost:8080/helloServlet/HelloServlet http://localhost:8080/helloServlet/HelloServlet
> 12:13:30,024 WARN [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-2) Cannot resolve resource: cxf
> 12:13:30,030 INFO [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-2) WSDL published to: file:/home/jimma/x1/code/git-client/maerqiang-work/jboss-as/build/target/jboss-as-7.1.0.Alpha1-SNAPSHOT/standalone/data/wsdl/helloServlet.war/HelloServletImplService.wsdl
> 12:13:31,517 INFO [org.jboss.as.webservices.service.EndpointService] (MSC service thread 1-10) Starting service jboss.ws.endpoint.helloServlet.HelloServlet
As you see the HelloServletImpl.class (configured in web.xml <servlet-class>servlet.hello.helloservlet.HelloServletImpl</servlet-class>) is not a real servlet class, the webservie deployer will modify the web.xml and start the endpoint impl before the real servlet - org.jboss.wsf.stack.cxf.CXFServletExt which servers the servlt transport initialize and start to work. These webservice deployers which output above message are executed before the web deployer to create WebContext . That's why you see it is executed after the HelloServlet is Initialized. But ServletContextListener is actually executed as expected before the real servlets are initialized. Here in your war file is after CXFServletExt and Startup are initialized.
> * *Why is "<load-on-startup>" ignored when the implementation differ only in the WS implementation?*
>
It is not ignored. The <load-on-startup> configured to HelloServlet is passed to org.jboss.wsf.stack.cxf.CXFServletExt. I tried with your example it works properly.
> rushead wrote:
> * Last but not least: What is the best and usual way to initialize a custom environment for several servlets in a war file?
>
I did not get what you want to initialize from the source code(maybe I missed something), so I am not sure if do the initialize work in a real servlet and inject something with WebServiceContext can help. Here is some documentation about how to access MessageContext and/or Http request and response: http://cxf.apache.org/docs/servlet-transport.html http://cxf.apache.org/docs/servlet-transport.html
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617278#617278]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 9 months
Invitation for Open Source Project
by Peter Penzov
Hi,
I'm starting an open source project which involves web based Java, JBoss
application server and JBoss Seam 3. I'm a student and I work on the project
in my free time for training. Every one who want to take a part in this
hobby project in his free time is invited. Send me e-mail.
peter. penzov(at)gmail. com
Regards
Peter
12 years, 9 months
[JBoss AS7 Development] - Re: Data sources in EAR on AS7?
by henk de boer
henk de boer [http://community.jboss.org/people/henk53] created the discussion
"Re: Data sources in EAR on AS7?"
To view the discussion, visit: http://community.jboss.org/message/617383#617383
--------------------------------------------------------------
> Sebastian Koske wrote:
>
> This script will then create all datasources, queues, topics and security domains and so on and also deploy the archive into the running server. I think this will be acceptable and maybe also suitable for you?
Yes, such an approach will be acceptable for the deployment to our servers. Since we use the tool Fabric for deployment, we might even be able to copy the script out of the EAR and then run it programmatically to already achieve the affect Jesper intended with his .cli archives.
I'm thinking how to best support local development though. Currently our system is such that a developer simply has to checkout the EAR project in Eclipse, add it to the JBoss tools server runtime and he or she is good to go.
Letting the developer run the script once is painful, but doable. However, during development resources can be added, removed or renamed at any time and I'm not sure how to best handle that.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617383#617383]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 9 months
[JBoss AS7 Development] - ClassNotFoundException when deploying ear file on Jboss AS 7
by Catalin Moga
Catalin Moga [http://community.jboss.org/people/mcatalin23] created the discussion
"ClassNotFoundException when deploying ear file on Jboss AS 7"
To view the discussion, visit: http://community.jboss.org/message/617351#617351
--------------------------------------------------------------
I included my ear file into <jboss_home>\standalone\deployments\ folder.
The ear file was generated with Jboss Developer Studio version 4.0.0.GA.
I'm getting following error when starting Jboss 7 as standalone:
12:07:08,729 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."<ear_name>.ear".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."<ear_name>.ear".INSTALL: Failed to process phase INSTALL of deployment "<ear_name>.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
Caused by: java.lang.RuntimeException: Error getting reflective information for class <my_class_name>
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
at org.jboss.as.ee.component.EEModuleClassDescription$DefaultConfigurator.configure(EEModuleClassDescription.java:144)
at org.jboss.as.ee.component.EEClassConfigurationProcessor.processClasses(EEClassConfigurationProcessor.java:133)
at org.jboss.as.ee.component.EEClassConfigurationProcessor.deploy(EEClassConfigurationProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
... 5 more
*Caused by: java.lang.NoClassDefFoundError: Lorg/apache/log4j/Category;*
at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_23]
at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_23]
at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_23]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
... 9 more
*Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Category from [Module "deployment.<ear_name>.ear.<jar_name>.jar:main" from Service Module Loader]*
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
... 14 more
Following instructions from
https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application... https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application...
section "+How to find the JBoss module dependency"+
I searched for the jboss 7 module that contains the class *org.apache.log4j.Category*
The class is included into following jar: <jboss_home>\modules\org\apache\log4j\main\log4j-1.2.16.jar
>From module.xml file I got the module name *org.apache.log4j*, and I added this module name to the Dependencies in the MANIFEST.MF file:
like *Dependencies: org.apache.log4j*
I did all these steps from the documentation but I still get the same error ClassNotFoundException.
I have tried to update the main MANIFEST.MF file from the ear and also the MANIFEST.MF file from jar included into the ear that requires the class.
The MANIFEST.MF file I used is attached.
Where is the problem regarding this issue?
Is anything wrong with my configuration for manifest file? I manually edited the manifest file.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617351#617351]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 9 months
[JBoss AS7 Development] - JBREM00200: Remote connection failed: java.io.IOException: Received an invalid message length of 1347375956
by Gary Quinn
Gary Quinn [http://community.jboss.org/people/JavaPenguin] created the discussion
"JBREM00200: Remote connection failed: java.io.IOException: Received an invalid message length of 1347375956"
To view the discussion, visit: http://community.jboss.org/message/617349#617349
--------------------------------------------------------------
When starting JBoss 7.0.0 Final in standalone mode I get the error below, doe anyone know what it is trying to do/connect to.
gary@gary-desktop:~/data/etc/jboss/jboss-as-7.0.0.Final/bin$ ./standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/gary/data/etc/jboss/jboss-as-7.0.0.Final
JAVA: /usr/lib/jvm/java-6-sun-1.6.0.26//bin/java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman
=========================================================================
11:32:45,059 INFO [org.jboss.modules] JBoss Modules version 1.0.1.GA
11:32:45,211 INFO [org.jboss.msc] JBoss MSC version 1.0.0.GA
11:32:45,246 INFO [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting
11:32:45,838 INFO [org.jboss.as] creating http management service using network interface (management) port (9990) securePort (-1)
11:32:45,846 INFO [org.jboss.as.logging] Removing bootstrap log handlers
11:32:45,857 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
11:32:45,864 INFO [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
11:32:45,938 INFO [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem
11:32:45,945 INFO [org.jboss.as.naming] (MSC service thread 1-3) Starting Naming Service
11:32:45,949 INFO [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem
11:32:45,961 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
11:32:45,965 INFO [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 3.2.0.Beta2
11:32:45,972 INFO [org.xnio] (MSC service thread 1-5) XNIO Version 3.0.0.Beta3
11:32:45,981 INFO [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.0.0.Beta3
11:32:46,112 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-14) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
11:32:46,119 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-9) Starting remote JMX connector
11:32:46,128 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
11:32:46,132 INFO [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:9999
11:32:46,218 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-15) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
11:32:46,254 INFO [org.jboss.as.connector] (MSC service thread 1-3) Starting JCA Subsystem (JBoss IronJacamar 1.0.0.CR2)
11:32:46,279 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) Bound data source [java:jboss/datasources/ExampleDS]
11:32:46,526 INFO [org.jboss.as.deployment] (MSC service thread 1-7) Started FileSystemDeploymentService for directory /home/gary/data/etc/jboss/jboss-as-7.0.0.Final/standalone/deployments
11:32:46,535 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started in 1616ms - Started 92 of 147 services (55 services are passive or on-demand)
11:32:55,135 ERROR [org.jboss.remoting.remote] (XNIO NIO Read 1) JBREM00200: Remote connection failed: java.io.IOException: Received an invalid message length of 1347375956
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617349#617349]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 9 months