Dave Robinson

Greenhorn
+ Follow
since May 11, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Dave Robinson

I am having a problem with retrieving values from a view that I created. I have created a mapping file, entity and updated my applicationContext to list the entity in the sessionFactory. My DAO attempts to retrieve all values from the view as a list, but it returns a list of the correct size but all null values. What can be causing this, I have another view and other tables that do not give me this issue. Please advise, is there something that I am missing?

I am using Spring3.0.6 and hibernate 3.6.2

************************hbm.xml***********************


*************************DAO***************************


**********************Entity*****************************


***********Embedded id**********************



I am writing a test client for my ejb and I am getting an exception while trying to do a lookup. I am thinking that my ejb-jar.xml or weblogic-ejb-jar.xml is not configured properly or my value I am passing for the lookup is not correct.



javax.naming.NameNotFoundException: While trying to lookup 'demo.DemoHome' didn't find subcontext 'demo'. Resolved '' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'demo.DemoHome' didn't find subcontext 'demo'. Resolved '']; remaining name 'demo/DemoHome'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at weblogic.jndi.internal.ServerNamingNode_1032_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:405)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at ejb.demo.DemoClient.main(DemoClient.java:35)
Caused by: javax.naming.NameNotFoundException: While trying to lookup 'demo.DemoHome' didn't find subcontext 'demo'. Resolved ''
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)

ejb-jar.xml

<ejb-jar id="ejb-jar_ID">
<display-name>demo</display-name>
<enterprise-beans>
<session>
<ejb-name>DemoBean</ejb-name>
<home>ejb.demo.DemoHome</home>
<remote>ejb.demo.Demo</remote>
<ejb-class>ejb.demo.DemoBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<ejb-client-jar>DemoClient.jar</ejb-client-jar>
</ejb-jar>


weblogic-ejb-jar.xml

<wls:weblogic-ejb-jar xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" 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/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
<wls:weblogic-enterprise-bean>
<wls:ejb-name>DemoBean</wls:ejb-name>
<wls:stateless-session-descriptor></wls:stateless-session-descriptor>
<wls:jndi-name>ejb.demo.Demo.DemoBean</wls:jndi-name>
</wls:weblogic-enterprise-bean>
</wls:weblogic-ejb-jar>

Someone please advise
I am using WSAD and I created a javabean called confirmBean in the default package. It contains two private properties fname, lname and has public setters and getters

In a servlet I placed values in the beans properties, then placed the bean in a request and then forwarded to confirm.jsp

confirmBean cb = new confirmBean();
cb.setFname("testing");
cb.setLname("aaa");
req.setAttribute("mybean", cb);
req.getRequestDispatcher("/confirm.jsp").forward(req,res);

Here is my JSP, I used java syntax for retrieving javabean:

<HTML>
<HEAD>
<TITLE>confirm.jsp</TITLE>
</HEAD>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"%>
<%@ page import="confirmBean"%>
<BODY>

<% confirmBean myBean = (confirmBean)request.getAttribute("MYBEAN"); %>
<%= myBean.getFname() %>

</BODY>
</HTML>

and here is the error i am getting when executing:

Error 500: Unable to compile class for JSP c:\testWorkspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\local host\server1\Test\TestWeb.war\_confirm.java:3: '.' expected import confirmBean; ^ An error occurred at line: 11 in the jsp file: /confirm.jsp Generated servlet error: c:\testWorkspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\local host\server1\Test\TestWeb.war\_confirm.java:78: cannot resolve symbol symbol : class confirmBean location: class org.apache.jsp._confirm confirmBean myBean = (confirmBean)request.getAttribute("MYBEAN"); ^ An error occurred at line: 11 in the jsp file: /confirm.jsp Generated servlet error: c:\testWorkspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\local host\server1\Test\TestWeb.war\_confirm.java:78: cannot resolve symbol symbol : class confirmBean location: class org.apache.jsp._confirm confirmBean myBean = (confirmBean)request.getAttribute("MYBEAN"); ^ 3 errors

Please help!!!
20 years ago
JSP
I am trying to implement security constraints to my web app, how do I assign users to the roles in WSAD? Is there an equivalent to tomcat-users.xml?
20 years ago