Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem when deploying entity bean in Weblogic 5.1

Posted on 2001-06-18
9
Medium Priority
?
348 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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

916 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