[EJB3 Development] - java.lang.NullPointerException in EJB3 from JSP page
by Moazzam Munir
Moazzam Munir [https://community.jboss.org/people/mmunir] created the discussion
"java.lang.NullPointerException in EJB3 from JSP page"
To view the discussion, visit: https://community.jboss.org/message/649905#649905
--------------------------------------------------------------
I am developing my first EJB 3 application using JBOSS 7 as application server in Eclipse. The session bean is deployed successfully on the server but when i try to access it from the JSP page, then i get the java.lang.NullPointerException exception.
Following is my code:
*Local Interface*:
package my.first;
import javax.ejb.Local;
@Local
public interface CalculatorRemote {
public float add(float x, float y);
public float subtract(float x, float y);
public float multiply(float x, float y);
public float division(float x, float y);
}
*Session bean*:
package my.first;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
@Stateless(name = "CalculatorRemote")
public class CalculatorBean implements CalculatorRemote {
public float add(float x, float y) {
return x + y;
}
public float subtract(float x, float y) {
return x - y;
}
public float multiply(float x, float y) {
return x * y;
}
public float division(float x, float y) {
return x / y;
}
}
*JSP Page:*
<%!
private CalculatorRemote calculator = null;
float result=0;
public void jspInit() {
try {
InitialContext ic = new InitialContext();
calculator = (CalculatorRemote) ic
.lookup("CalculatorRemote/Local");
System.out.println("Loaded Calculator Bean");
//CalculatorBean
} catch (Exception ex) {
System.out.println("Error:"+
ex.getMessage());
}
}
public void jspDestroy() {
calculator = null;
}
%>
*Server Log File:*
17:17:20,552 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named CalculatorRemote in deployment unit deployment "EJBsession.jar" are as follows:
java:global/EJBsession/CalculatorRemote!my.first.CalculatorBean
java:app/EJBsession/CalculatorRemote!my.first.CalculatorBean
java:module/CalculatorRemote!my.first.CalculatorBean
java:global/EJBsession/CalculatorRemote!my.first.CalculatorRemote
java:app/EJBsession/CalculatorRemote!my.first.CalculatorRemote
java:module/CalculatorRemote!my.first.CalculatorRemote
......
......
......
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) java.lang.NullPointerException
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.jsp.test_jsp._jspService(test_jsp.java:102)
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
......
......
......
Please help?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/649905#649905]
Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss AS 7 Development] - Who would like to help integrate the Javeleon class reloading system into JBoss 7.1+?
by Allan Gregersen
Allan Gregersen [https://community.jboss.org/people/gregersen] created the discussion
"Who would like to help integrate the Javeleon class reloading system into JBoss 7.1+?"
To view the discussion, visit: https://community.jboss.org/message/740818#740818
--------------------------------------------------------------
Hi all,
I don't really know where to ask this question, but here it goes. I'm one of the guys behind the Javeleon class reloading system that currently supports full class redefinition for Java SE applications and NetBeans Platform based applications. We're in the process of moving into the app servers and would like to start with JBoss 7.1+. The current status of our JBoss 7.1 integration is that we can dynamically update java classes within web-apps running in exploded WAR mode. This is nice, but way more integration is required for us to be able to update changes to configurations and such. If someone would help pointing out particular places in the source tree of JBoss 7.1 that would be much appreciated, e.g. where is the web-xml, jboss.web-xml parsed and injected? How do we refresh JSP's and things like that. Any help would be much appreciated.
Think of Javeleon as a more powerfull class reloading engine than JRebel. We support changes to the super class as well as changes to implemented interfaces, so when we have JBoss integration in place it will be awesome for you (developers) to work with JBoss and Javeleon.
Please let us know either here or at mailto:support@javeleon.org support(a)javeleon.org if you wish to help our quest under way.
Thanks a lot,
Allan
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740818#740818]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[EJB3 Development] - Invoke remote ejb's with additional custom properties
by vedanth k r
vedanth k r [https://community.jboss.org/people/vedanth] created the discussion
"Invoke remote ejb's with additional custom properties"
To view the discussion, visit: https://community.jboss.org/message/741686#741686
--------------------------------------------------------------
Hi All
I have deployed stateless beans in jboss as 7 and i use a remote ejb client to access the deployed ejb's every thing seems to work fine with the below code.
Remote client code:
*Hashtable p = new Hashtable();*
* p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");*
* p.put(Context.PROVIDER_URL, "remote://localhost:4547/");*
* p.put("jboss.naming.client.ejb.context", true);*
* p.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");*
* p.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");*
* final Context context = new javax.naming.InitialContext(p);*
*context.lookup("ejb:employee/employeeService//EmployeeManagementImpl!my.tests.EmployeeManagement");*
Now i want to set additional properties in the context and get the same properties in the deployed stateless beans.
Set something like *context.addToEnvironment("customDataKey", "customDataValue");* in client code
and get the same properties in deployed beans like
*@Resource*
*EJBContext ejbContext;*
*ejbContext.getEnvironment();*
*or*
*ejbContext.getContextData()*
Is it possible to do this???? or any other alternative.....
Am confused as to how to achieve this.
Thanks in advance...
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741686#741686]
Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss AS 7 Development] - JBoss AS 7.2.0.Alpha1-SNAPSHOT Issue
by Manoj Agarwal
Manoj Agarwal [https://community.jboss.org/people/manoj.m.agarwal] created the discussion
"JBoss AS 7.2.0.Alpha1-SNAPSHOT Issue"
To view the discussion, visit: https://community.jboss.org/message/741452#741452
--------------------------------------------------------------
Hi,
I get this issue when i run standalone.bat with standalone-teiid.xml as config file for JBoss AS 7.2.0.Alpha1.
17:43:09,158 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.server.ServerService.boot(ServerService.java:270) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:156) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_02]
Caused by: javax.xml.stream.XMLStreamException: JBAS014674: Failed to load module org.jboss.teiid
at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:154) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:306) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:127) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:99) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
... 3 more
Caused by: java.util.concurrent.ExecutionException: javax.xml.stream.XMLStreamException: JBAS014674: Failed to load module
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) [rt.jar:1.7.0_02]
at java.util.concurrent.FutureTask.get(FutureTask.java:111) [rt.jar:1.7.0_02]
at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:146) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
... 9 more
Caused by: javax.xml.stream.XMLStreamException: JBAS014674: Failed to load module
at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:195) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.parsing.ExtensionXml.access$000(ExtensionXml.java:68) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:126) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:123) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_02]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_02]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_02]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_02]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_02]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\Users\agama05\ProjectWork\Chorus_JBOSS\Chorus\chorus-main\server\chorus-server-run\target\chorus\jboss\modules\org\jboss\teiid\main\module.xml
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:293) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:243) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.LocalModuleLoader.parseModuleInfoFile(LocalModuleLoader.java:138) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:122) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:204) [jboss-modules.jar:1.1.2.GA]
at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:177) [jboss-as-controller-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
... 9 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,83]
Message: Failed to add resource root 'teiid-jboss-integration-8.1.0.Alpha2-SNAPSHOT.jar' at path 'teiid-jboss-integration-8.1.0.Alpha2-SNAPSHOT.jar'
at org.jboss.modules.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:899) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:855) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:677) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:549) [jboss-modules.jar:1.1.2.GA]
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:288) [jboss-modules.jar:1.1.2.GA]
... 17 more
17:43:09,165 FATAL [org.jboss.as.server] JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
17:43:09,173 INFO [org.jboss.as] JBAS015950: JBoss AS 7.2.0.Alpha1-SNAPSHOT "Steropes" stopped in 4ms
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741452#741452]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss ESB Development] - Error deploying ESB project on server 5.1.0 using eclipse environment
by Themba Shezi
Themba Shezi [https://community.jboss.org/people/mrtshezi] created the discussion
"Error deploying ESB project on server 5.1.0 using eclipse environment"
To view the discussion, visit: https://community.jboss.org/message/741531#741531
--------------------------------------------------------------
Hi all,
I'm a new in JBoss ESB integration, i configured my environment in eclipse and i have JBoss ESB 4.9 runnning on server 5.1.0
I developed an ESB example following tutotials specified in http://www.mastertheboss.com/jboss-esb/78-jboss-esb.html?start=1 http://www.mastertheboss.com/jboss-esb/78-jboss-esb.html?start=1
When i try to deploy this project it returns the following error, Can you please help get through this. i have been working around it for few days now
17:21:58,775 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossProject.esb/" is missing the following dependencies:
Dependency "<UNKNOWN jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossProject.esb/>" (should be in state "PreInstall", but is actually in state "** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_gw,service=Queue' **")
Dependency "<UNKNOWN jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossProject.esb/>" (should be in state "PreInstall", but is actually in state "** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_esb,service=Queue' **")
DEPLOYMENTS IN ERROR:
Deployment "<UNKNOWN jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossProject.esb/>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_gw,service=Queue' **, ** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_esb,service=Queue' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
17:22:18,899 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossHelloWold.esb/" is missing the following dependencies:
Dependency "<UNKNOWN jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossHelloWold.esb/>" (should be in state "PreInstall", but is actually in state "** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_esb,service=Queue' **")
Dependency "<UNKNOWN jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossHelloWold.esb/>" (should be in state "PreInstall", but is actually in state "** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_gw,service=Queue' **")
DEPLOYMENTS IN ERROR:
Deployment "<UNKNOWN jboss.esb.vfsfile:/C:/eclipse/Workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1339595861867/deploy/JBossHelloWold.esb/>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_gw,service=Queue' **, ** UNRESOLVED Demands 'jboss.esb.quickstart.destination:name=quickstart_helloworld_Request_esb,service=Queue' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741531#741531]
Start a new discussion in JBoss ESB Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months