Solved

Problem when deploying entity bean in Weblogic 5.1

Posted on 2001-06-18
9
337 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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
LVL 3

Accepted Solution

by:
yerkan earned 200 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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSV file parsing thru Java 13 54
Cisco ASA: Java web start no go, asdm launcher no go 3 88
Domain hosting question about hiding URL 9 52
JVM error from eclipse 1 26
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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

734 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