Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

Megan James

Greenhorn
+ Follow
since Nov 21, 2008
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 Megan James

I am new to EJB - entity bean, I need to know EJB 2.1 CMP . Could any one post some sample code .
I have some problem in BMP- EJB 2.1 ...

code for CutomerBean
=================
private Connection getConnection() throws NamingException, SQLException {
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("java:comp/env/jdbc/SimpleDB");
// DataSource ds = (DataSource)ic.lookup("Customer");
return ds.getConnection();
}

ejb-jar.xml
=======
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>Customer</ejb-name>
<home>sjdavies.ejb.bmp.CustomerHome</home>
<remote>sjdavies.ejb.bmp.Customer</remote>
<ejb-class>sjdavies.ejb.bmp.CustomerBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<resource-ref>
<description>Declare the reference to the DataSource.</description>
<res-ref-name>jdbc/SimpleDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Customer</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

weblogic-ejb-jar.xml
=============
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Customer</ejb-name>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/SimpleDB</res-ref-name>
<jndi-name>SimpleDB</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>SimpleDB</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>


index.jsp
======
CustomerHome cHome;
InitialContext ctx = new InitialContext();
Object objref=ctx.lookup("SimpleDB");
cHome = (CustomerHome) PortableRemoteObject.narrow(objref, CustomerHome.class);
cust = cHome.create(s);



Error:
====
java.lang.ClassCastException: sjdavies.ejb.bmp.Customer_7og5ho_HomeImpl
at sjdavies.ejb.bmp.CustomerBean.getConnection(CustomerBean.java:47)
at sjdavies.ejb.bmp.CustomerBean.ejbCreate(CustomerBean.java:73)
at sjdavies.ejb.bmp.Customer_7og5ho_Impl.ejbCreate(Customer_7og5ho_Impl.
java:285)
at sjdavies.ejb.bmp.CustomerBean.ejbCreate(CustomerBean.java:58)
at sjdavies.ejb.bmp.Customer_7og5ho_Impl.ejbCreate(Customer_7og5ho_Impl.
java:263)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at weblogic.ejb.container.manager.ExclusiveEntityManager.create(Exclusiv
eEntityManager.java:775)
at weblogic.ejb.container.manager.ExclusiveEntityManager.remoteCreate(Ex
clusiveEntityManager.java:746)
at weblogic.ejb.container.internal.EntityEJBHome.create(EntityEJBHome.ja



I got the error in the CutomerBean.java.can any one tell me how to solve this error.
I created the executable jar file with the attachment of referenced jar file thruogh the following code.

<jar basedir="build/classes"
destfile="build/jar/ATOOL.jar"
includes="**/*.*"
excludes="**/*Test*"
manifest="MANIFEST.MF" />

But , the program is not run running because of some reference mismatch.

could anyone tell me how to run the jar file with referenced jar file?. OR wher to put the jar to reference this?...


12 years ago
The above problem was caused because of some problem in my word format. I solved it. Thanks for your Help.
12 years ago
Thanks for your comments. I got the jar file and set class path.

When running the above code it shows the following error . Kindly help me to proceed future.

org.apache.poi.hpsf.IllegalPropertySetDataException: The property set claims to have a size of 16 bytes. However, it exceeds 16 bytes.
12 years ago
Thanks for your reply sir. I tried to downloaded the jar file , but i got only the source code its also not compiled properly, It has some file as missing in that. could you provide the url for downloaded the jar file of open source or how can i get the complete source code.could you help me to proceed future.
12 years ago
Could any one give some sample code to read the .doc (MS word ) file with the font style, family and size usi ng java?.
12 years ago


i try to get the pdf text to java string , but the above code doesnt help me .
could any one help me to proceed future.
12 years ago
could give the sample code for convert pdf text to String using java with the font style and size.
12 years ago
could any one help me how to read the pdf file with the corresponding font family, stlye and size using JAVA.
12 years ago
Could any one know how read the pdf with font style, family and size for each and every word or line?.

12 years ago