Solved

Problem when deploying entity bean in Weblogic 5.1

Posted on 2001-06-18
9
333 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Groovy:unable to resolve class error 2 70
eclipse java  build path 6 45
ForLoop Example 3 40
Create sub domain on windows dedicated server. 11 4
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
The viewer will learn how to implement Singleton Design Pattern in Java.

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now