[JBoss Web Services] - POJO Endpoint causes NPE at JBossWebMetaDataParser.parse
by abhi0123
abhi0123 [https://community.jboss.org/people/abhi0123] created the discussion
"POJO Endpoint causes NPE at JBossWebMetaDataParser.parse"
To view the discussion, visit: https://community.jboss.org/message/730079#730079
--------------------------------------------------------------
POJO Endpoint deployed with web.xml and jboss-web.xml. When enabled, or attempted to, JBOSS AS 7 fails with NPE. Source code and deployable attached.
15:16:25,985 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC00001: Failed to start service jboss.deployment.unit."jaxws-pojo-endpoint-1.0.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jaxws-pojo-endpoint-1.0.war".PARSE: Failed to process phase PARSE of deployment "jaxws-pojo-endpoint-1.0.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]
Caused by: java.lang.NullPointerException
at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:100)
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:69)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
*TimeServiceSEI.java*
@WebService
public interface TimeServiceSEI {
public Time getCurrentTime();
public Time getCurrentTimeAfterHttpBasicAuthentication();
public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization();
public Time getCurrentTimeAfterProgrammaticRoleBasedAuthorization();
public Time getCurrentTimeAfterUserPrincipalAuthentication();
public Time getCurrentTimeAfterProgrammaticAuthentication();
}
*TimeService.java*
@WebService(name = "Time", serviceName = "TimeService", portName = "TimeServicePort", targetNamespace = "http://abhijitsarkar.certification.edu/ocewsd/jaxws/pojo/endpoint", endpointInterface = "edu.certification.abhijitsarkar.ocewsd.jaxws.pojo.endpoint.TimeServiceSEI")
@HandlerChain(file = "handler-chain.xml")
@DeclareRoles({ "AppUser" })
public class TimeService implements TimeServiceSEI {
@WebMethod
@PermitAll
@Override
public Time getCurrentTime() {
return new Time();
}
/* HttpBasicAuthenticationHandler authenticates this request */
@WebMethod
@Override
public Time getCurrentTimeAfterHttpBasicAuthentication() {
return getCurrentTime();
}
@WebMethod
@RolesAllowed("AppUser")
@Override
public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization() {
return getCurrentTime();
}
// some more methods
}
*web.xml*
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<security-constraint>
<web-resource-collection>
<web-resource-name>All resources</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>POST</http-method> <!-- GET is used to receive TimeService?wsdl -->
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Pojo Auth Test Realm</realm-name>
</login-config>
</web-app>
*jboss-web.xml*
<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_7_0.xsd"
version="7.0">
<security-domain>other</security-domain>
<context-root>/jaxws-pojo-endpoint</context-root>
</jboss>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/730079#730079]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years
[Datasource Configuration] - local or xa datasource
by ashvish
ashvish [https://community.jboss.org/people/ashvish] created the discussion
"local or xa datasource"
To view the discussion, visit: https://community.jboss.org/message/729166#729166
--------------------------------------------------------------
Hi,
I have an enterprise application that is configured to use just one local-tx datasource (ds1). The transaction isolation level is set to transaction serializable. As part of reducing database contention, I was thinking of configuring another local tx datasource (ds2) which would be used only for reading committed data from the database for example use for reports. But while experimenting with the same I find that while ds1 is in the process of doing read and save operations to the db, a read operation using ds2 waits till ds1's transaction is over. Is it possible to overcome this by using xa-datasource? If so is jTDS driver the best available option to use? I have searched a lot about this, but haven't found any concrete solution yet. Any suggestions would be highly appreciated. JBoss version being used is 4.
Thanks
Ashvish
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/729166#729166]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years
[JBoss Tools] - target/project.war different from project.war that is Run On Server
by Tanya Ruttenberg
Tanya Ruttenberg [https://community.jboss.org/people/daxxy] created the discussion
"target/project.war different from project.war that is Run On Server"
To view the discussion, visit: https://community.jboss.org/message/727819#727819
--------------------------------------------------------------
I have gone back and forth between manually building my project using a Run Configuration and simply deploying my app onto the server using Run As... -> Run On Server. The latter is easier, you don't have to take that first step of building the war file manually and you don't have to mark the target/project.war as Deployable (for some reason the voice in my brain always says "Mark as Deplorable" , but I digress....)
So today I needed to customize the packaging of my app to put persistence.xml into /META-INF rather than in /WEB-INF/classes/META-INF. Building the war file manually using a Run Configuration produces different results than what I get in the my deployed app. I assume that what gets deployed uses the pom to build the app, is that true? What actually happens when you do a Run On Server? Is it supposed to be different than what you do when you do a "mvn clean package"? How can I get the result I want in the Run As->Run On Server version?
Here are the two structures. The first is take from my target subdirectory right after mvn clean package and the second is from the deployments directory, which I reached by right-clicking on the deployed app icon and selecting Explore from the context menu. In the first (correct - manually generated) build, persistence.xml is in the correct place. In the 2nd build, it appears twice, and this is messing up the deployment.
d:\Development2\j2ee6\contacts-as7\target>jar -tf contacts-as7.war
META-INF/
META-INF/MANIFEST.MF
icons/
style/
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/gov/
WEB-INF/classes/gov/ssa/
WEB-INF/classes/gov/ssa/dne/
WEB-INF/classes/gov/ssa/dne/nmst/
WEB-INF/classes/gov/ssa/dne/nmst/action/
WEB-INF/lib/
contact.xhtml
favicon.ico
icons/add.png
icons/check.png
icons/delete.png
icons/edit.png
index.html
index.xhtml
META-INF/persistence.xml
style/nmst.css
test.xhtml
WEB-INF/beans.xml
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactService.class
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactView.class
WEB-INF/faces-config.xml
WEB-INF/lib/commons-beanutils-1.8.0.jar
WEB-INF/lib/commons-digester-2.0.jar
WEB-INF/lib/commons-lang-2.6.jar
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/contacts-model-as7-0.0.1-SNAPSHOT.jar
WEB-INF/lib/cssparser-0.9.5.jar
WEB-INF/lib/ehcache-1.6.0.jar
WEB-INF/lib/guava-10.0.1.jar
WEB-INF/lib/hibernate-validator-4.2.0.Final.jar
WEB-INF/lib/javax.faces-2.1.5.jar
WEB-INF/lib/joda-time-1.6.jar
WEB-INF/lib/jsr305-1.3.9.jar
WEB-INF/lib/jstl-api-1.2.jar
WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
WEB-INF/lib/prettyfaces-core-3.3.2.jar
WEB-INF/lib/richfaces-components-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-components-ui-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-impl-4.2.0.Final.jar
WEB-INF/lib/sac-1.3.jar
WEB-INF/lib/seam-faces-3.1.0.Final.jar
WEB-INF/lib/seam-faces-api-3.1.0.Final.jar
WEB-INF/lib/seam-international-3.1.0.Final.jar
WEB-INF/lib/seam-international-api-3.1.0.Final.jar
WEB-INF/lib/seam-persistence-api-3.1.0.Final.jar
WEB-INF/lib/seam-security-api-3.1.0.Final.jar
WEB-INF/lib/seam-transaction-api-3.1.0.Final.jar
WEB-INF/lib/servlet-api-2.5.jar
WEB-INF/lib/slf4j-api-1.6.1.jar
WEB-INF/lib/solder-api-3.1.0.Final.jar
WEB-INF/lib/solder-impl-3.1.0.Final.jar
WEB-INF/lib/solder-logging-3.1.0.Final.jar
WEB-INF/lib/validation-api-1.0.0.GA.jar
WEB-INF/web.xml
META-INF/maven/
META-INF/maven/gov.ssa.dne.nmst/
META-INF/maven/gov.ssa.dne.nmst/contacts-as7/
META-INF/maven/gov.ssa.dne.nmst/contacts-as7/pom.xml
META-INF/maven/gov.ssa.dne.nmst/contacts-as7/pom.properties
d:\Development2\jboss-eap-6.0.0.Beta1\jboss-eap-6.0\standalone\deployments>jar -tf contacts-as7.jar
contact.xhtml
favicon.ico
icons/
icons/add.png
icons/check.png
icons/delete.png
icons/edit.png
index.html
index.xhtml
META-INF/
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/gov.ssa.dne.nmst/
META-INF/maven/gov.ssa.dne.nmst/
META-INF/maven/gov.ssa.dne.nmst/pom.properties
META-INF/maven/gov.ssa.dne.nmst/pom.xml
META-INF/persistence.xml
style/
style/nmst.css
test.xhtml
WEB-INF/
WEB-INF/beans.xml
WEB-INF/classes/
WEB-INF/classes/gov/
WEB-INF/classes/gov/ssa/
WEB-INF/classes/gov/ssa/dne/
WEB-INF/classes/gov/ssa/dne/nmst/
WEB-INF/classes/gov/ssa/dne/nmst/action/
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactService.class
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactView.class
WEB-INF/classes/import.sql
WEB-INF/classes/META-INF/
WEB-INF/classes/META-INF/persistence.xml
WEB-INF/faces-config.xml
WEB-INF/lib/
WEB-INF/lib/commons-beanutils-1.8.0.jar
WEB-INF/lib/commons-digester-2.0.jar
WEB-INF/lib/commons-lang-2.6.jar
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/contacts-model-as7-0.0.1-SNAPSHOT.jar
WEB-INF/lib/cssparser-0.9.5.jar
WEB-INF/lib/ehcache-1.6.0.jar
WEB-INF/lib/guava-10.0.1.jar
WEB-INF/lib/hibernate-validator-4.2.0.Final.jar
WEB-INF/lib/javax.faces-2.1.5.jar
WEB-INF/lib/joda-time-1.6.jar
WEB-INF/lib/jsr305-1.3.9.jar
WEB-INF/lib/jstl-api-1.2.jar
WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
WEB-INF/lib/prettyfaces-core-3.3.2.jar
WEB-INF/lib/richfaces-components-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-components-ui-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-impl-4.2.0.Final.jar
WEB-INF/lib/sac-1.3.jar
WEB-INF/lib/seam-faces-3.1.0.Final.jar
WEB-INF/lib/seam-faces-api-3.1.0.Final.jar
WEB-INF/lib/seam-international-3.1.0.Final.jar
WEB-INF/lib/seam-international-api-3.1.0.Final.jar
WEB-INF/lib/seam-persistence-api-3.1.0.Final.jar
WEB-INF/lib/seam-security-api-3.1.0.Final.jar
WEB-INF/lib/seam-transaction-api-3.1.0.Final.jar
WEB-INF/lib/servlet-api-2.5.jar
WEB-INF/lib/slf4j-api-1.6.1.jar
WEB-INF/lib/solder-api-3.1.0.Final.jar
WEB-INF/lib/solder-impl-3.1.0.Final.jar
WEB-INF/lib/solder-logging-3.1.0.Final.jar
WEB-INF/lib/validation-api-1.0.0.GA.jar
WEB-INF/web.xml
This is the stack trace I get when the deployment bombs
14:22:57,349 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "contacts-as7.war"
14:22:58,502 WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
14:22:58,502 WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
14:22:58,593 INFO [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for contactsDb
14:22:58,593 INFO [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for contactsDb
14:22:58,593 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment "contacts-as7.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]
Caused by: java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 2 persistence unit definitions in application deployment "contacts-as7.war". Either change the application to have only one persistence unit definition or specify the unitName for each reference to a persistence unit.
at org.jboss.as.jpa.container.PersistenceUnitSearch.resolvePersistenceUnitSupplier(PersistenceUnitSearch.java:69)
at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getPersistenceUnit(JPAAnnotationParseProcessor.java:284)
at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getBindingSource(JPAAnnotationParseProcessor.java:220)
at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processField(JPAAnnotationParseProcessor.java:151)
at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processPersistenceAnnotations(JPAAnnotationParseProcessor.java:118)
at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.deploy(JPAAnnotationParseProcessor.java:90)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
... 5 more
14:22:58,633 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "contacts-as7.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"contacts-as7.war\".DEPENDENCIES" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"contacts-as7.war\".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment \"contacts-as7.war\""}}
14:22:58,733 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment contacts-as7.war in 95ms
14:22:58,733 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment "contacts-as7.war"
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/727819#727819]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years