Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1014187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:12:58+00:00 2026-05-16T10:12:58+00:00

I’m getting the following error when trying to build my very simple webservice project.

  • 0

I’m getting the following error when trying to build my very simple webservice project. I’ve given the build.xml, my java file and path values

The class file is getting generated, but service is not getting generated.

Please help… It’s bugging for a looooong time..

Thanks! 🙂

CLASSPATH=C:\bea\weblogic81\server\lib\weblogic.jar;C:\bea\weblogic81\server\lib
\webservices.jar;C:\bea\weblogic81\server\lib\ojdbc14.jar;C:\j2sdk1.4.2_18\jre\l
ib\rt.jar;c:\ant\apache-ant-1.5.4\lib\ant.jar;c:\ant\apache-ant-1.5.4\lib\option
al.jar;

Path=C:\Program Files\Reflection;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre
\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;C:\Program Files\Windows Im
aging\;C:\j2sdk1.4.2_18\bin;c:\j2sdk1.4.2_18\bin;c:\ant\apache-ant-1.5.4\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH


UserModel.java

import java.sql.*;
import java.util.*;

public class UserModel
{


    Connection con=null;

    Statement st=null;
    Statement st1=null;
    ResultSet rs=null;
    String nm,age,course,address,mob,IdNum1;
    int IdNum,id;
    int x;
    int check=0;
    ArrayList list=new ArrayList();
    ArrayList eptylist=new ArrayList();
    UserModel() 
    {
    }

    public int insert(String name,String age,String course,String address,int Mob) throws  SQLException, ClassNotFoundException 

    {
        Class.forName("oracle.jdbc.driver.OracleDriver"); 
        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.142.22:40401:MKTMRM9","mrm2","Marms*123.");

          st=con.createStatement();

          x= st.executeUpdate("insert into student values(seqno.nextval,'"+name+"','"+age+"','"+course+"','"+address+"','"+Mob+"')");

          if(x==1)
        {
        st1=con.createStatement();       
         rs=st.executeQuery("select seqno.currval from student");

          while(rs.next())
          {   

              IdNum=rs.getInt(1);

          }
        return IdNum;

        }
               else
        return 0;

    }   

    public ArrayList getDetails(int id1) throws  SQLException, ClassNotFoundException
    {
        Class.forName("oracle.jdbc.driver.OracleDriver"); 
        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.142.22:40401:MKTMRM9","mrm2","Marms*123.");
        st=con.createStatement();
        rs=st.executeQuery("select * from student where StudentId="+id1);
        while(rs.next())
        {
            check++;
            id=rs.getInt(1);
            nm=rs.getString(2);
            age=rs.getString(3);
            course=rs.getString(4);
            address=rs.getString(5);
            mob=rs.getString(6);

        }

        list.add(new Integer(id));
        list.add(nm);
        list.add(age);
        list.add(course);
        list.add(address);
        list.add(mob);
        if(check!=0)
        return list;
        else 
        return eptylist; 
    }

}

build.xml

<?xml version="1.0"?> 
<project name="WebServiceServer" default="create" basedir=".">

<taskdef name="servicegen" classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"/>


<property name="src" value=".\src"/>
<property name="build" value=".\build"/>
<property name="namespace" value="http://localhost:7001/UserModel"/>

<target name="create">

<javac srcdir="${src}" destdir="${build}" includes="**/*.java">
</javac>


<servicegen
    destEar="myWebServer.ear"
    warName="mywebserver.war"
    contextURI="WebServiceServer">

    <service
        javaClassComponents="UserModel"
        targetNamespace="${namespace}"
        serviceName="UserModel"
        serviceURI="/UserModel"
        generateTypes="True"
        expandMethods="True"
        style="rpc">
    </service>

    <classpath>
        <pathelement path="${build}"/>
        <pathelement path="${java.class.path}"/>
        <pathelement path="{lib}/ojdbc14.jar"/>
    </classpath>

</servicegen>

</target>

</project>

error from console – while ant is run

    Buildfile: build.xml

    create:
        [javac] Compiling 1 source file to C:\Documents and Settings\344756\New\MyWe
    b\WebServiceServer\build
    [servicegen] Generating service "UserModel" ...
    [servicegen] java.lang.SecurityException: Prohibited package name: java.lang
    [servicegen]    at java.lang.ClassLoader.defineClass(ClassLoader.java:524)
    [servicegen]    at java.security.SecureClassLoader.defineClass(SecureClassLoader
    .java:123)
    [servicegen]    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass
    (GenericClassLoader.java:476)
    [servicegen]    at weblogic.utils.classloaders.GenericClassLoader.findClass(Gene
    ricClassLoader.java:181)
    [servicegen]    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    [servicegen]    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    [servicegen]    at weblogic.utils.classloaders.GenericClassLoader.loadClass(Gene
    ricClassLoader.java:223)
    [servicegen]    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

    [servicegen]    at java.lang.Class.forName0(Native Method)
    [servicegen]    at java.lang.Class.forName(Class.java:219)
    [servicegen]    at weblogic.xml.schema.binding.internal.codegen.Compiler.loadCla
    ss(Compiler.java:641)
    [servicegen]    at weblogic.xml.schema.binding.internal.codegen.Compiler.addToMa
    pping(Compiler.java:450)
    [servicegen]    at weblogic.xml.schema.binding.internal.codegen.Compiler.compile
    (Compiler.java:175)
    [servicegen]    at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
    pClass(XSDTypeMappingBuilder.java:89)
    [servicegen]    at weblogic.xml.schema.binding.internal.XSDTypeMappingBuilder.ma
    pClass(XSDTypeMappingBuilder.java:102)
    [servicegen]    at weblogic.xml.schema.binding.internal.TypeMappingBuilderBase.a
    ddMapping(TypeMappingBuilderBase.java:180)
    [servicegen]    at weblogic.ant.taskdefs.webservices.autotype.ComponentAutoTyper
    .addMapping(ComponentAutoTyper.java:88)
    [servicegen]    at weblogic.ant.taskdefs.webservices.autotype.ComponentAutoTyper
    .mapComponent(ComponentAutoTyper.java:141)
    [servicegen]    at weblogic.ant.taskdefs.webservices.autotype.JavaAutoTyper.run(
    JavaAutoTyper.java:81)
    [servicegen]    at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.r
    unAutoTyper(ServiceGenTask.java:367)
    [servicegen]    at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.g
    enerateService(ServiceGenTask.java:313)
    [servicegen]    at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.e
    xecute(ServiceGenTask.java:181)
    [servicegen]    at org.apache.tools.ant.Task.perform(Task.java:341)
    [servicegen]    at org.apache.tools.ant.Target.execute(Target.java:309)
    [servicegen]    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [servicegen]    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)

    [servicegen]    at org.apache.tools.ant.Project.executeTargets(Project.java:1255
    )
    [servicegen]    at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [servicegen]    at org.apache.tools.ant.Main.start(Main.java:196)
    [servicegen]    at org.apache.tools.ant.Main.main(Main.java:235)

    BUILD FAILED
    file:C:/Documents%20and%20Settings/344756/New/MyWeb/WebServiceServer/build.xml:2
    0: java.lang.SecurityException: Prohibited package name: java.lang

    Total time: 1 second
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:12:59+00:00Added an answer on May 16, 2026 at 10:12 am

    What package are your own classes in?

    This error happens because it’s forbidden to put your own classes in the package java.lang. It looks like you are trying to compile a class that’s in the package java.lang.

    If your own classes are not in a package at all (you don’t have a package statement at the top of your source files), then put them in a package.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm parsing an XML file, the creators of it stuck in a bunch social
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.