[Beginner's Corner] - Problem with war file deployment
by Dilruwan Madubashitha
Dilruwan Madubashitha [https://community.jboss.org/people/techlegend] created the discussion
"Problem with war file deployment"
To view the discussion, visit: https://community.jboss.org/message/716743#716743
--------------------------------------------------------------
First of all I am very new to jboss AS and this is my first assignment on jboss AS and I did search for couple of weeks in the forums and Internet before poping up this question.
I have a war file which is distributed in the standalone jboss server and all the things works fine except the part where certain pages load its values from a property file and when ever I browse those pages it is not working and following exceptions can be seen in the log.
What can be the reason for this.
btw THis web app uses spring MVC and hibernate and deployment on apache tomcat version 6 works without any problem
14:23:07,603 ERROR [stderr] (MSC service thread 1-4) 2339 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/addEmployee.htm] onto handler 'AddNewEmployeeController'
14:23:07,619 ERROR [stderr] (MSC service thread 1-4) 2355 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/deleteRole.htm] onto handler 'DeleteRoleController'
14:23:07,619 ERROR [stderr] (MSC service thread 1-4) 2355 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/dashboardView.htm] onto handler 'dashboardViewController'
14:23:07,635 ERROR [stderr] (MSC service thread 1-4) 2371 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/viewRole.htm] onto handler 'viewRoleController'
14:23:07,635 ERROR [stderr] (MSC service thread 1-4) 2371 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/index.htm] onto handler 'userLoginController'
14:23:07,650 ERROR [stderr] (MSC service thread 1-4) 2386 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/viewCourse.htm] onto handler 'viewCourseController'
14:23:07,650 ERROR [stderr] (MSC service thread 1-4) 2386 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/deleteEmployee.htm] onto handler 'DeleteEmployeeController'
14:23:07,666 ERROR [stderr] (MSC service thread 1-4) 2402 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/addCourse.htm] onto handler 'addCourseController'
14:23:07,682 ERROR [stderr] (MSC service thread 1-4) 2418 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/addNewRole.htm] onto handler 'AddNewRoleController'
14:23:07,682 ERROR [stderr] (MSC service thread 1-4) 2418 [MSC service thread 1-4] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/viewEmployee.htm] onto handler 'ViewEmployeeController'
14:23:07,776 ERROR [stderr] (MSC service thread 1-4) 2512 [MSC service thread 1-4] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'bttr': initialization completed in 345 ms
14:23:07,776 INFO [org.jboss.web] (MSC service thread 1-4) registering web context: /BTTR
14:23:07,839 INFO [org.jboss.as.server.controller] (HttpManagementService-threads - 2) Deployed "BTTR.war"
14:23:58,026 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/BTTR].[bttr]] (http--127.0.0.1-7000-1) Servlet.service() for servlet bttr threw exception: java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:418) [:1.6.0_27]
at java.util.Properties.load0(Properties.java:337) [:1.6.0_27]
at java.util.Properties.load(Properties.java:325) [:1.6.0_27]
at com.bt.bttr.common.controller.ViewRoleController.referenceData(ViewRoleController.java:140) [classes:]
at org.springframework.web.servlet.mvc.SimpleFormController.referenceData(SimpleFormController.java:218) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.AbstractFormController.showForm(AbstractFormController.java:578) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:201) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:178) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:341) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:281) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2054) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
14:24:21,228 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/BTTR].[bttr]] (http--127.0.0.1-7000-1) Servlet.service() for servlet bttr threw exception: java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:418) [:1.6.0_27]
at java.util.Properties.load0(Properties.java:337) [:1.6.0_27]
at java.util.Properties.load(Properties.java:325) [:1.6.0_27]
at com.bt.bttr.common.LoadProperties.loadProps(LoadProperties.java:31) [classes:]
at com.bt.bttr.common.validator.LoginValidator.validate(LoginValidator.java:47) [classes:]
at org.springframework.validation.ValidationUtils.invokeValidator(ValidationUtils.java:63) [org.springframework.context-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(BaseCommandController.java:398) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:266) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) [org.springframework.web.servlet-3.0.5.RELEASE.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2054) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/716743#716743]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[EJB3] - Internal invocation of EJB3 bean methods
by Paul Robinson
Paul Robinson [https://community.jboss.org/people/paul.robinson] created the discussion
"Internal invocation of EJB3 bean methods"
To view the discussion, visit: https://community.jboss.org/message/716885#716885
--------------------------------------------------------------
Hello,
I have a scenario where I am using CDI to add an interceptor to an EJB method. The interceptor is as follows:
@ServiceRequest
@Interceptor
public class ServiceRequestInterceptor
{
@AroundInvoke
public Object intercept(InvocationContext ic) throws Throwable
{
Method serviceMethod = ic.getMethod();
Object serviceImpl = ic.getTarget();
ProtocolHandler protocolHandler = HandlerFactory.createInstance(serviceImpl, serviceMethod);
return protocolHandler.proceed(ic);
}
}
This registers the EJB implementation class and the intercepted method with my middleware. My middleware will then invoke methods on the EJB at various times. The problem I am having is that the EJB implementing instance is invoked directly, by my middleware, due to the way I am obtaining the reference. This doesn't seem like the right approach to me as it is bypassing the EJB3 interceptors. Also, the EJB may be re-allocated, pasivated, etc, which is going to result in odd behavior, I expect.
Should I somehow look up the local stub to the EJB, based on what information I can gather from the implementation class; or is there a better way?
Thanks,
Paul.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/716885#716885]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[Beginner's Corner] - JBoss with Websphere MQ connection issue: DetailedIllegalStateException
by Harshil Desai
Harshil Desai [https://community.jboss.org/people/harshildesai] created the discussion
"JBoss with Websphere MQ connection issue: DetailedIllegalStateException"
To view the discussion, visit: https://community.jboss.org/message/716864#716864
--------------------------------------------------------------
Hi
We connect to WebspehereMQ for sending and receiving the JMS messages in our JBoss EAP 4.2 app server - this was all working fine. Now there has been an upgrade of the WMQ series from version 5.2 to 7. We have been provided with the new libraries and new hostName for making this change at our end.
I have made the following changes:
- updated the hostName in custom datasource file +ful-jms-ds.xml + which looks like this:
<connection-factories>
<tx-connection-factory>
<jndi-name>MyTestQueueConnectionFactory</jndi-name>
<xa-transaction />
<rar-name>wmq.jmsra.rar</rar-name>
<connection-definition>javax.jms.ConnectionFactory</connection-definition>
<config-property name="channel" type="java.lang.String">JAVA.CHANNEL</config-property>
<config-property name="hostName" type="java.lang.String">myserver</config-property>
<config-property name="port" type="java.lang.String">myport</config-property>
<config-property name="queueManager" type="java.lang.String">MYTEST.MW</config-property>
<config-property name="transportType" type="java.lang.String">CLIENT</config-property>
<security-domain-and-application>JmsXARealm</security-domain-and-application>
</tx-connection-factory>
<!-- admin object definition Queue Setting -->
<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=myTestQueue">
<attribute name="JNDIName">TestQueue</attribute>
<depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
<attribute name="Type">javax.jms.Queue</attribute>
<attribute name="Properties">
baseQueueManagerName=MYTEST.MW
baseQueueName=MYTESTSQL.ECOMMERCEORDERS
</attribute>
</mbean>
</connection-factories>
- Replaced the deployer file +wmq.jmsra.rar+ with the new one at +JBOSS_HOME/server/server_name/deploy/+ directory
The JNDI lookup and connection creation is done from the Java class in the ear. There are no WMQ specific classes used in the java class hence no libraries need to be changed in the ear. Here is the method
public void sendMessage(String textMessage, String jndiQueueConnFactory , String jndiQueue) throws JMSException , SystemException
{
Connection tempConnection = null;
private ConnectionFactory queueConnectionFactory_OFS;
try
{
Context ctx = new InitialContext();
if(null == queueConnectionFactory_OFS)
{
queueConnectionFactory_OFS = (ConnectionFactory)ctx.lookup(jndiQueueConnFactory);
}
if(null == queue_OFS)
queue_OFS = (Queue) ctx.lookup(jndiQueue);
tempConnection = queueConnectionFactory_OFS.createConnection();
tempConnection.start();
Session session = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(queue_OFS);
TextMessage message = session.createTextMessage();
message.setText(textMessage);
producer.send(message);
if(null != tempConnection)
{
tempConnection.stop();
tempConnection.close();
}
}
catch (JMSException e)
{
throw new SystemException("JMSException while connecting to Queue");
}
catch(NamingException ne)
{
throw new SystemException("NamingException while connecting to Queue");
}
}
When i send the JMS messages, the message do reach the new queues, however, there are exception in the logs which i suspect is coming while closing the connection:
2012-02-13 07:47:35,302 ERROR [STDERR] com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1031: The method can only be called in the application client container.
The application was not running in the application client container when this method was called. Ensure that the application runs in the application client container,
or modify the application to avoid this method call.
2012-02-13 07:47:35,303 ERROR [STDERR] at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:149)
2012-02-13 07:47:35,303 ERROR [STDERR] at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:86)
2012-02-13 07:47:35,303 ERROR [STDERR] at com.ibm.mq.connector.outbound.ConnectionWrapper.stop(ConnectionWrapper.java:221)
Can you please help me. Let me know if you need any other information.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/716864#716864]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[Performance Tuning] - Re: Client JBOSS Communication takes long time on threaded remote calls
by Hardik Shah
Hardik Shah [https://community.jboss.org/people/hardikshah] created the discussion
"Re: Client JBOSS Communication takes long time on threaded remote calls"
To view the discussion, visit: https://community.jboss.org/message/716832#716832
--------------------------------------------------------------
I am also facing the similar issue.
Below is sample statistics for a load testing i executed.
| Milli Second | Number of Request | Percentage with respect to total request |
| <=1 | 9215 | 8.99 |
| >1 and <=2 | 30016 | 29.28 |
| >2 and <=5 | 41046 | 40.04 |
| >5 and <=10 | 18899 | 18.44 |
| >10 | 3324 | 3.24 |
| | | |
| Total Request | 102500 | |
I have also created a client program which makes RMI call to my JBoss application. I have commented my business logic in Session Bean and just giving success response directly from Session Bean.
>From client, i am sending a packet with event timestamp value and in session bean i am comparing the timestamp received and current timestamp.
Through above I am calculating the time taken in milli seconds for request to reach my session bean. And same I am printting in log. (only one log per request)
So above statistics clearly shows that more than 60% of requests taking more than 2 milli second, which is not acceptable for my kind of application.
Please guide me as well for the solution.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/716832#716832]
Start a new discussion in Performance Tuning at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months