Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem when deploying entity bean in Weblogic 5.1

Posted on 2001-06-18
9
Medium Priority
?
343 Views
Last Modified: 2013-11-24
When I try to build the xml files using ejbc utility (entity beans using the downloads available in weblogic.com) I get the following error:
C:\demoejb\sampc>java -classpath \java\lib\classes.zip;\weblogic\classes;\weblog
ic\lib\weblogicaux.jar;\weblogic\myserver\clientclasses -Dweblogic.home=\weblogi
c weblogic.ejbc -compiler javac build\std_ejb_basic_containerManaged.jar \weblog
ic\myserver\ejb_basic_containerManaged.jar
org.xml.sax.SAXParseException: XML declaration may only begin entities.
        at com.sun.xml.parser.Parser.fatal(Parser.java:2797)
        at com.sun.xml.parser.Parser.fatal(Parser.java:2785)
        at com.sun.xml.parser.Parser.maybePI(Parser.java:938)
        at com.sun.xml.parser.Parser.maybeMisc(Parser.java:1061)
        at com.sun.xml.parser.Parser.parseInternal(Parser.java:478)
        at com.sun.xml.parser.Parser.parse(Parser.java:283)
        at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:69)
        at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
        at weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.j
ava:151)
        at weblogic.ejbc.runBody(ejbc.java:298)
        at weblogic.utils.compiler.Tool.run(Tool.java:80)
        at weblogic.ejbc.main(ejbc.java:353)

The examples that come with Weblogic server are getting deployed properly but when i try to deploy an example given in Ed Romans book i get this error. Any thoughts would be greatly appreciated
0
Comment
Question by:mrkumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 4

Expert Comment

by:jerch
ID: 6202849
Can you post your ejb-jar.xml? There must be syntactic error in your deployment descriptor.

Jerson
0
 
LVL 3

Expert Comment

by:yerkan
ID: 6203400
Hi,

- Your deployment description XML file may be corrupted,
- The same file may contain syntax errors,
- You may have a XML parser conflict in your classpath...

Please check those points,

Regards,

    Yagiz Erkan
    http://www.erkans.com
0
 

Author Comment

by:mrkumar
ID: 6204873
here is the contents of ejb-jar.xml

  <?xml version="1.0" ?>
  <!DOCTYPE ejb-jar (View Source for full doctype...)>
- <ejb-jar>
- <enterprise-beans>
- <entity>
  <ejb-name>containerManaged</ejb-name>
  <home>examples.ejb.basic.containerManaged.AccountHome</home>
  <remote>examples.ejb.basic.containerManaged.Account</remote>
  <ejb-class>examples.ejb.basic.containerManaged.AccountBean</ejb-class>
  <persistence-type>Container</persistence-type>
  <prim-key-class>java.lang.String</prim-key-class>
  <reentrant>False</reentrant>
- <cmp-field>
  <field-name>accountId</field-name>
  </cmp-field>
- <cmp-field>
  <field-name>balance</field-name>
  </cmp-field>
- <cmp-field>
  <field-name>accountType</field-name>
  </cmp-field>
  <primkey-field>accountId</primkey-field>
  </entity>
  </enterprise-beans>
- <assembly-descriptor>
- <container-transaction>
- <method>
  <ejb-name>containerManaged</ejb-name>
  <method-intf>Remote</method-intf>
  <method-name>*</method-name>
  </method>
  <trans-attribute>Required</trans-attribute>
  </container-transaction>
  </assembly-descriptor>
  </ejb-jar>

Here is the contents of weblogic-ejb-jar.xml

<?xml version="1.0" ?>
  <!DOCTYPE weblogic-ejb-jar (View Source for full doctype...)>
- <weblogic-ejb-jar>
- <weblogic-enterprise-bean>
  <ejb-name>containerManaged</ejb-name>
- <caching-descriptor>
  <max-beans-in-cache>1000</max-beans-in-cache>
  </caching-descriptor>
- <persistence-descriptor>
  <is-modified-method-name>isModified</is-modified-method-name>
- <persistence-type>
  <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
  <type-version>5.1.0</type-version>
  <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
  </persistence-type>
- <persistence-use>
  <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
  <type-version>5.1.0</type-version>
  </persistence-use>
  </persistence-descriptor>
  <jndi-name>containerManaged.AccountHome</jndi-name>
  </weblogic-enterprise-bean>
  </weblogic-ejb-jar>
And here's the contents of weblogic-cmp-rdbms-jar.xml

demoPool ejbAccounts accountId id balance bal accountType type findBigAccounts double balance $0)]]> findAccount double findNullAccounts false

    What do you think ?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 3

Accepted Solution

by:
yerkan earned 800 total points
ID: 6205851
Hi,

The "!DOCTYPE" instructions may be wrong. Try this:

<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>

for ejb-jar.xml and

<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>

for weblogic-ejb-jar.xml.

You will also have to remove the '-' characters in the beginning of some lines if there are really there in your source code.

Regards,

    Yagiz
    http://www.erkans.com
0
 

Author Comment

by:mrkumar
ID: 6206290
Yagiz..i got this fixed with your comment....now i get the following error after that...any idea ?

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd demoejb

C:\demoejb>cd sampc

C:\demoejb\sampc>build

C:\demoejb\sampc>if "" == "" set JAVA_HOME=\java

C:\demoejb\sampc>if "" == "" set WL_HOME=\weblogic

C:\demoejb\sampc>set MYSERVER=\weblogic\myserver

C:\demoejb\sampc>set MYCLASSPATH=\java\lib\classes.zip;\weblogic\classes;\weblog
ic\lib\weblogicaux.jar;\weblogic\myserver\clientclasses

C:\demoejb\sampc>mkdir build build\META-INF

C:\demoejb\sampc>copy *.xml build\META-INF
ejb-jar.xml
weblogic-cmp-rdbms-jar.xml
weblogic-ejb-jar.xml
        3 file(s) copied.

C:\demoejb\sampc>javac -d build -classpath \java\lib\classes.zip;\weblogic\class
es;\weblogic\lib\weblogicaux.jar;\weblogic\myserver\clientclasses Account.java A
ccountHome.java ProcessingErrorException.java AccountBean.java

C:\demoejb\sampc>cd build

C:\demoejb\sampc\build>jar cv0f std_ejb_basic_containerManaged.jar META-INF exam
ples
examples : no such file or directory
added manifest
ignoring entry META-INF/
adding: META-INF/ejb-jar.xml(in = 1169) (out= 1169)(stored 0%)
adding: META-INF/weblogic-cmp-rdbms-jar.xml(in = 143) (out= 143)(stored 0%)
adding: META-INF/weblogic-ejb-jar.xml(in = 936) (out= 936)(stored 0%)

C:\demoejb\sampc\build>cd ..

C:\demoejb\sampc>java -classpath \java\lib\classes.zip;\weblogic\classes;\weblog
ic\lib\weblogicaux.jar;\weblogic\myserver\clientclasses -Dweblogic.home=\weblogi
c weblogic.ejbc -compiler javac build\std_ejb_basic_containerManaged.jar \weblog
ic\myserver\ejb_basic_containerManaged.jar
ERROR: Error from ejbc: Unable to load a class required by your EJB: examples.ej
b.basic.containerManaged.AccountBean
ERROR: ejbc found errors

C:\demoejb\sampc>javac -d \weblogic\myserver\clientclasses -classpath \java\lib\
classes.zip;\weblogic\classes;\weblogic\lib\weblogicaux.jar;\weblogic\myserver\c
lientclasses Account.java AccountHome.java ProcessingErrorException.java Client.
java
C:\demoejb\sampc>

My files are under the sampc folder.
0
 
LVL 3

Expert Comment

by:yerkan
ID: 6206436
> examples : no such file or directory

It can't find the "examples" directory when you create the jar file. Can you doublecheck if you have a subdirectory called "examples" under "C:\demoejb\sampc\build"?

Yagiz
http://www.erkans.com
0
 

Author Comment

by:mrkumar
ID: 6206452
Yagiz,
    I checked and there is no examples folder under build. but it is the build.cmd utility that creates this build folder. If it needs the examples folder shouldn't it be creating it automatically ?

Michael (m-rkumar@eth.net)
0
 

Author Comment

by:mrkumar
ID: 6206491
Yagiz,
   Do you think we can chat online.
my MSN id is m_rkumaris@hotmail.com
my yahoo id is : m_rkumar@yhaoo.com and
AIM id is rmichaelk

Looking forward to chat with you. Michael
0
 

Author Comment

by:mrkumar
ID: 6206652
Yagiz,
   Do you think we can chat online.
my MSN id is m_rkumaris@hotmail.com
my yahoo id is : m_rkumar@yhaoo.com and
AIM id is rmichaelk

Looking forward to chat with you. Michael
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question