alec stewart stewart

Ranch Hand
+ Follow
since Dec 23, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by alec stewart stewart

Dear all java experts
i am kinda new in java.So it well helpful if you can explain clearly what is early binding and what is late binding.
thanks
regards
16 years ago
greetings to you all
i am using jboss 3.2.3 with xdoclet 1.2.2 and eclipse combination.When ever i try to create a new enterprise bean in eclipse the create enterprise java bean wizard of eclipse gives only two options session bean and message driven bean and it does not give the option of entity beans.
Is something wrong with xdoclet or what.
It will be very kind of you people to help me out on this.
greetings to you all
i am using jboss 3.2.3 with xdoclet 1.2.2 and eclipse combination.When ever i try to create a new enterprise bean in eclipse the create enterprise java bean wizard of eclipse gives only two options session bean and message driven bean and it does not give the option of entity beans.
Is something wrong with xdoclet or what.
It will be very kind of you people to help me out on this.
:roll:
16 years ago
karthik guru
can u please help me by providing me with a small working example of the solution that you have mentioned.
thanks in advance
Purushothaman
can u please give me a simple example code on the second method that u r telling.
hi friends
i want to know how can i fetch values from two related tables using cmp.like there are to tables employee and designation.employee table consist designation id. when i perform findall it returns all values from employee table including desig_id but i want to find the desigation name corresponding to designation id.
a small example will be of great help.
thanks :roll:
Dear friends
i am using jboss 3.2.3
when ever i compile my classes i have to restart the server to make effect the changes.can any one pls help in out so that to enable my server for class reloading.
like in tomcat when we compile any class the server takes in the effect of the changed classes.
thanks in advance
18 years ago
yes of course you can specify name as follows

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html>
<head>
<title>Sample Struts Application</title>
</head>
<body>
<html:form action="Name" name="nameForm" type="example.NameForm">
<table width="80%" border="0">
<tr>
<td>Name:</td>
<td><html:text property="name" /></td>
</tr>
<tr>
<td><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>
18 years ago
hello everybody
Friends i am new into struts a helpinghand from you will enable me to master this technology
friends i am getting the following error:
org.apache.jasper.JasperException: No getter method for property desig of bean designation
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:536)


root cause

javax.servlet.ServletException: No getter method for property desig of bean designation
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
at org.apache.jsp.designationlist_jsp._jspService(designationlist_jsp.java:155)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:536)


my designationlist.jsp is as follows
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html>
<head>
<title><bean:message key="app.title" /></title>
</head>
<body>

<table width="650"
border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="7"> </td>
</tr>
<tr>
<td height="68" width="48%">
<div align="left">

</div>
</td>
</tr>
<tr>
<td colspan="7"> </td>
</tr>
</table>

<html:errors />

<table width="700"
border="0" cellspacing="0" cellpadding="0">
<tr align="left">
<th><bean:message key="app.username" /></th>

</tr>
<!-- iterate over the results of the query -->
<logic:iterate id="designation" name="designations">
<tr align="left">
<td>
<bean:write name="designation" property="desig" />
</td>

</td>
<td>

</td>
</tr>
</logic:iterate>
<tr>
<td colspan="7">
<hr>
</td>
</tr>
</table>
<font size="-1" face="arial">
<a href="adddesignation.jsp">Add New Designation</a>
</font>

</body>
</html>

DesignationData.java

package com.wrox;

import java.rmi.*;
import java.util.*;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.*;
import teste.*;
import masters.designation.*;
import javax.naming.*;
import javax.rmi.*;
import java.util.Date;
public class DesignationData {
public static Designations getDesignation(String desig, DataSource dataSource)
throws Exception {

Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
Designations designation = null;
try {

conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery("select * from designation where desigName=\'"
+ desig + "'");

if ( rs.next() ) {

designation = new Designations();

designation.setDesig(rs.getString("desig"));

}
else {

throw new Exception("Designation " + desig + " not found!");
}
}

finally {

if ( rs != null ) {

rs.close();
}
if ( stmt != null ) {

stmt.close();
}
if ( conn != null ) {

conn.close();
}
}
return designation;
}

public static Collection getDesignations() {

Designations designation = null;
Collection designations = null;
//Collection d=null;



try {
System.out.println("in function getDesignations ");
Context ic = new InitialContext();
Object o = ic.lookup("ejb/Example/Designation");
DesignationHome home = (DesignationHome) PortableRemoteObject.narrow(o, DesignationHome.class);
Designation dn=null;
designations = home.findAll();
Object[] a = designations.toArray();
//Iterator i=d.iterator();
System.out.println("stage 1");
for(int k=0;k<a.length;k++)
{
System.out.println("sanjay"+a[k].toString());
designation = new Designations();
//Designations ds=new Designations();
designation.setDesig(a[k].toString());
designations.add(designation);
System.out.println("stage 2");
}

}

catch(Exception e)
{
e.printStackTrace();}

return designations;
}

public static void removeDesignation(String desig, DataSource dataSource)
throws Exception {

Connection conn = null;
Statement stmt = null;
ResultSet rs = null;

try {

conn = dataSource.getConnection();
stmt = conn.createStatement();

StringBuffer sqlString =
new StringBuffer("delete from deignation ");
sqlString.append("where desigName='" + desig + "'");

stmt.execute(sqlString.toString());
}
finally {

if ( rs != null ) {

rs.close();
}
if ( stmt != null ) {

stmt.close();
}
if ( conn != null ) {

conn.close();
}
}
}

public static void addDesignation(Designations designation, DataSource dataSource)
throws Exception {

Connection conn = null;
Statement stmt = null;
ResultSet rs = null;

try {

/* conn = dataSource.getConnection();
stmt = conn.createStatement();
StringBuffer sqlString =
new StringBuffer("insert into employees ");

sqlString.append("values (\'"+ employee.getUsername() + "\', ");
sqlString.append("\'" + employee.getPassword() + "\', ");
sqlString.append("\'" + employee.getName() + "\', ");
sqlString.append( employee.getRoleid() +"," );
//sqlString.append("\'" + employee.getName() + "\', ");
sqlString.append("\'" + employee.getPhone() + "\', ");
sqlString.append("\'" + employee.getEmail() + "\', ");
sqlString.append(employee.getDepid() + ")");
System.out.println("The query before "+sqlString.toString());
stmt.execute(sqlString.toString());
System.out.println("The query after "+sqlString.toString());*/

Context ic = new InitialContext();
Object o = ic.lookup("ejb/Example/Designation");
DesignationHome home = (DesignationHome) PortableRemoteObject.narrow(o, DesignationHome.class);
Designation d=null;


d = home.create(designation.getDesig());
System.out.println("Recored inserted");
}
catch(Exception e)
{
e.printStackTrace();}
finally {

if ( rs != null ) {

rs.close();
}
if ( stmt != null ) {

stmt.close();
}
if ( conn != null ) {

conn.close();
}
}
}

public static void updateDesignation(Designations desig, DataSource dataSource)
throws Exception {

Connection conn = null;
Statement stmt = null;
ResultSet rs = null;

try {

conn = dataSource.getConnection();
stmt = conn.createStatement();

StringBuffer sqlString =
new StringBuffer("update designation ");

sqlString.append("set desigName='"
+ desig.getDesig() + "', ");

sqlString.append(" where desigName='"
+ desig.getDesig() + "'");

stmt.execute(sqlString.toString());
}
finally {

if ( rs != null ) {

rs.close();
}
if ( stmt != null ) {

stmt.close();
}
if ( conn != null ) {

conn.close();
}
}
}
}

DesignationListAction.java
package com.wrox;
import java.util.*;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import java.util.ArrayList;

public class DesignationListAction extends Action {

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {

// Default target to success
String target = new String("success");

Collection designations = null;

designations = DesignationData.getDesignations();

request.setAttribute("designations", designations);

// Forward to the appropriate View
return (mapping.findForward(target));
}
}

DesignationForm.java
package com.wrox;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;

public class DesignationForm extends ActionForm {

protected String desig;


public void setDesig(String desig) {

this.desig = desig;
}

public String getDesig() {

return desig;
}

// This method is called with every request. It resets the Form
// attribute prior to setting the values in the new request.
public void reset(ActionMapping mapping, HttpServletRequest request) {

this.desig = "";
}

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();


if ( (desig == null) || (desig.length() == 0) ) {

errors.add("designation", new ActionError("errors.username.required"));
}
return errors;
}
}


Designations.java

/*
* Created on Dec 30, 2005
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.wrox;

/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class Designations {
protected String desig;


public void setDesig(String desig) {

this.desig = desig;
}

public String getDesig() {

return desig;
}

}
18 years ago
hi all
Friends can any one give me a short example of how i can fetch values from two or more related tables using cmp.
for eg tables employee and department are related. now if i implement a findall in employee cmp it returns me the dep_id and not its name.
i want to do something like this:
SELECT * from employee e ,department d where e.emp_id=d.dep_id
how can it be done through cmp (ejb-ql)
PLease it would prove to be a very helping hand if a friend among u can give me short example on this.
thanks to you all inadvance
hi everyone
the thing i am trying to achieve is that when onmouseover on a link a message comes in status bar displaying the href of the link,now i want to extract that message in a variable and use as alert(a)
i don't want this
window.status="hi there"
as i don't want to set any message i want to extract the original message when we put over the mouse or when that link is clicked the original status bar messages which comes .
like when we click on a link status bar shows the href or other href which the link is furthur redirected.

please friends help me on this i severly needs this thing
thanks in advance
hi all
i am not being able to understand what is wrong with my query

<query>
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT Object(Story) FROM story AS Story WHERE Story.storyId = ?]]></ejb-ql>
</query>

it gives the follwing error on deployment:
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement
'SELECT Object(Story) FROM story AS Story WHERE Story.storyId = ?'; - nested
throwable: (org.jboss.ejb.plugins.cmp.ejbql.TokenMgrError: Lexical error at line 1, col
umn 66. Encountered: <EOF> after : "")

if i use this then it works fine
<ejb-ql><![CDATA[SELECT Object(Story) FROM story AS Story WHERE Story.storyId = 6]]></ejb-ql>

but then it becomes hardcoded

PLease dear friends and seniors guide me on this i have been struggling on this from two days.

thanks
u can do this by
runtime.execute("jar cvf abc.jar *.*")
hi all
i have a table in mssql server2000 with an identity column
i am using cmp and my server is jboss 3.2.3
now when i am trying to crrate a record it gives me the following error
javax.ejb.CreateException: Error checking if entity exists:com.jnetdirect.jsql.x: Line 1: Incorrect syntax near 'WHERE'.

my ejb-jar.xml file is thus
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>Teste and Story</description>
<display-name>Teste and Story</display-name>
<enterprise-beans>
<entity>
<display-name>Department Entity CMP Bean</display-name>
<ejb-name>Department</ejb-name>
<unknown-pk>
<unknown-pk-class>java.lang.Integer</unknown-pk-class>
<column-name>depId</column-name>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>INTEGER</sql-type>
<auto-increment/>
</unknown-pk>

<home>masters.department.DepartmentHome</home>
<remote>masters.department.Department</remote>
<ejb-class>masters.department.DepartmentBean</ejb-class>
<reentrant>True</reentrant>
<persistence-type>Container</persistence-type>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>department</abstract-schema-name>
<prim-key-class>java.lang.Integer</prim-key-class>
<cmp-field><field-name>DepName</field-name></cmp-field>


</entity>

<resource-ref> <description>Default Database Connection</description><res-ref-name>jdbc/TestDS</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth> </resource-ref>
</enterprise-beans>



<assembly-descriptor >
<container-transaction>
<method>
<ejb-name>Story</ejb-name>
<method-name>*</method-name>
</method>

<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor >


</ejb-jar>



hi all
i am using sqlserver 2000 and jboss 3.2.3
i have a table with identity column
table department
depid int (with identity)
depname varchar
the problem is that when i am trying to insert a a value in a table with identity through cmp i get the following error:
Cannot insert explicit value for identity column in table 'department' when IDENTITY_INSERT is set to OFF.

i even went to the database and did the IDENTITY_INSERT to off.

here is my ejb-jar.xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>Teste and Story</description>
<display-name>Teste and Story</display-name>
<enterprise-beans>
<entity>
<display-name>Department Entity CMP Bean</display-name>
<ejb-name>Department</ejb-name>
<unknown-pk>
<unknown-pk-class>java.lang.Integer</unknown-pk-class>
<column-name>depId</column-name>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>int(4)</sql-type>
<auto-increment/>
</unknown-pk>
<entity-command name="key-generator" class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCKeyGeneratorCreateCommand"> <attribute name="key-generator-factory">UUIDKeyGeneratorFactory</attribute>
</entity-command>
<entity-command name="mssql-fetch-key"> <attribute name="pk-sql">SELECT @@IDENTITY</attribute>
</entity-command>
<home>masters.department.DepartmentHome</home>
<remote>masters.department.Department</remote>
<ejb-class>masters.department.DepartmentBean</ejb-class>
<reentrant>True</reentrant>
<persistence-type>Container</persistence-type>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>department</abstract-schema-name>
<primkey-field>DepId</primkey-field>
<prim-key-class>java.lang.Integer</prim-key-class>
<cmp-field><field-name>DepId</field-name></cmp-field>
<cmp-field><field-name>DepName</field-name></cmp-field>


</entity>

<resource-ref> <description>Default Database Connection</description><res-ref-name>jdbc/TestDS</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth> </resource-ref>
</enterprise-beans>


<entity-commands> <!-- define a command that uses an Oracle sequence to generate keys -->
<entity-command name="keygen" class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSQLServerCreateCommand"> </entity-command> </entity-commands>

<assembly-descriptor >
<container-transaction>
<method>
<ejb-name>Story</ejb-name>
<method-name>*</method-name>
</method>

<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor >


</ejb-jar>

and here are my create methods:
public Integer ejbCreate(String DepName) throws RemoteException, CreateException {
System.out.println("In ejbCreate()");

setDepName(DepName);

return null;
}

public void ejbPostCreate(String DepName) {
System.out.println("In ejbPostCreate()");
}