Tutorial for building J2EE Applications using JBOSS and ECLIPSE(1)

SAP 屏幕增强:客户商主数据屏幕增强(KNA1、KNB1、KNVV) 本文介绍了SAP系统中针对客户主数据(KNA1、KNB1、KNVV)进行屏幕增强的具体实现方法。主要内容包括:1)在SPRO配置中创建新条目;2)通过SE80创建函数组和程序(LZKNA1TOP等);3)设置子屏幕9001并添加自定义结构字段;4)利用BADI(CUSTOMER_ADD_DATA等)实现数据交互逻辑。文章分别详细说明了针对客户主数据的一般数据(KNA1)、公司代码数据(KNB1)和销售数据(KNVV)三类不同数据的增强配置步骤,包括函数模块创建、屏幕设置和BADI方法调用等关键技术点。 阅读详情
 

Chapter 1

Configuration of ECLIPSE to use JBOSS and LOMBOZ

Install Eclipse.

First of all we have to set up Eclipse Integrated Development Environment (IDE) with JBOSS as our application server.

So go to this page: http://www.eclipse.org/downloads/index.php and download the binary for the Eclipse editor. You can download the appropriate binary for your platform. This tutorial was developed using Linux (Red Hat 8.0) as the operating system.

Example : eclipse-SDK-2.1-linux-gtk.zip, eclipse-SDK-2.1-win32.zip

Note : Eclipse does not include a Java runtime environment (JRE). You will need at least a 1.3 level Java runtime or Java development kit (JDK) installed on your machine in order to run Eclipse.

Now unzip this file into your home directory.

[vishal@localhost eclipse]$ unzip eclipse-SDK-2.1-linux-gtk.zip
Archive: eclipse-SDK-2.1-linux-gtk.zip
Archive: eclipse-SDK-2.1-linux-gtk.zip
inflating: eclipse/plugins/org.eclipse.core.boot_2.1.0/boot.jar
inflating: eclipse/plugins/org.eclipse.core.boot_2.1.0/splash.bmp
inflating: eclipse/plugins/org.eclipse.core.boot_2.1.0/boot.xml
inflating: eclipse/plugins/org.eclipse.core.boot_2.1.0/plugin.properties
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------------------------------------------------------------------------
inflating: eclipse/install.ini
inflating: eclipse/startup.jar
inflating: eclipse/readme/readme_eclipse.html


Once you have unzipped this file you will have a directory called 'eclipse' in your home directory.
Go into that directory and run the script file called 'eclipse'.


[vishal@localhost eclipse]$ cd eclipse
[vishal@localhost eclipse]$ ls
cpl-v10.html features install.ini plugins startup.jar
eclipse icon.xpm notice.html readme workspace
[vishal@localhost eclipse]$ ./eclipse



This will run the Eclipse IDE on your workstation. Let's get familiar with this environment.




Install JBOSS.

Now Eclipse is installed and is running on your workstation, let's install JBOSS.

You can download JBOSS ready to run. Because JBOSS comes with a simple embedded Database (Hypersonic) and a web server (JBossWEB or Tomcat) you can use it out of the box without any initial configuration. Downloads can be accessed from either the JBOSS Project Page on SourceForge where you will always find up to date downloads (http://sourceforge.net/projects/jboss), or from the JBOSS Home Page where you will find useful information about JBoss, the official, free forums, project information etc., and also the download page http://www.jboss.org/downloads.jsp. For this tutorial we are using JBOSS-3.2.1 with the built-in 'Jetty' JBOSSWeb HTTP sever.

Example : jboss-3.2.1.zip (includes JBossWeb HTTP server and JSP/Servlet engine, EJB, CMP2.0, JCA, IIOP, Clustering, JTS, JMX.)

Note : JBOSS does not include a Java runtime environment (JRE).

First login as user 'root' and then unzip this file in a suitable place where you have enough space. I have unzipped it under an /opt/jboss/ directory.

It will create a directory named jboss-3.2.1 under /opt/jboss/.

Before you run JBOSS, in order to check your installation of JBOSS, make sure have you have following environment variables set.

JBOSS_HOME: /opt/jboss/jboss-3.2.1
JAVA_HOME: /usr/java/j2sdk1.4.1_02
CLASSPATH: /usr/java/j2sdk1.4.1_02/lib/tools.jar


Now go into directory jboss-3.2.1 and you will have all these directories.

[root@localhost jboss-3.2.1]# ls
bin client docs lib server

Go into the bin directory and you will find a script named run.sh.

Run this script from the command line. Hopefully it will start, and you will see this message.

15:12:59,876 INFO [Server] JBoss (MX MicroKernel) [3.2.1 (build: CVSTag=JBoss_3_2_1 date=200305041533)] Started in 59s:676ms.

Note: This means that JBOSS is installed and running successfully. Now, it's time to configure it from within the eclipse IDE.

In order to test JBOSS is running correctly, go to your web browser and access this url 'http://localhost:8080/jmx-console/index.jsp'.

Note: This page is referred as the 'JMX Management Console'.




If you can access this screen from your browser, JBOSS is running successfully.

Note that on this page under the sub-heading of 'jboss' there is a link 'service=Hypersonic'. Go to that link; that will bring up an 'MBean View' page. On this page there is an MBean operation called 'startDatabaseManager'; go there and press the 'Invoke' button. This will bring up the console for the embedded Hypersonic database, from where you can access schemas and do other database management operations.






Creating the Database Schema.

As mentioned in the case study, the schema for our Store's Inventory is composed of five relations. We will load this schema in the Hypersonic embedded database.

In order to that, we will use the following script files.

a) myStoreSchema.script – to create the database schema.

b) myStoreSchema.data – to populate the tables with data.

c) myStoreSchemaDrop.script – to drop/delete all tables used in this tutorial.

Downloads :

myStoreSchema.script

myStoreSchema.data

myStoreSchemaDrop.script



First of all copy these 3 files into the $JBOSS_HOME/server/default/data/hypersonic/ directory. In this example it is /opt/jboss/jboss-3.2.1/server/default/data/hypersonic/

Now access the HSQL Database Manager using the JMX-Management Console shown above.

Note: Please drop/delete any tables already present in the database with same name beforehand, or naturally errors will be raised when you will run these scripts.

On the top level menu of HSQL Database Manager File > Open Script.. > select myStoreSchema.script.






After clicking Open > press Execute SQL Statement and the following screen will appear as shown in the figure below.






Go to View > Refresh Tree. If you can see five new tables created then your schema is ready, and it's time to populate them with data.

Go to File > Open Script.. > select myStoreSchema.data > Open.. > Execute SQL Statement.






Now your data is loaded in the database, in order to verify just execute any query and see the results of that as shown in figure below.




Make sure you 'commit' (Options->commit) to save your schema in the database.

Note : Shutdown Jboss server as we will run it later from inside eclipse.

Install Lomboz.

In order to run JBOSS from within Eclipse you need a plug-in, and for this tutorial we are using Lomboz which is available from http://sourceforge.net/projects/lomboz or from http://www.objectlearn.com/index.jsp.

Note : We are using lomboz.21_02.zip for this tutorial.

Now unzip this file in a temporary directory; you will have a directory named plugins. Go to the directory plugins/com.objectlearn.jdt.j2ee/servers. This directory contains configuration files for various servers. For this tutorial we supply a configuration file for jboss3.2.1 available under downloads.

Note : If there are multiple configuration files the plugin will presently default to the first configuration file within the (eclipse/plugins/com.objectlearn.jdt.j2ee/servers/ ) directory in alphabetical order, so rename all the configuration files to a '.bak'
extension. This is just to avoid slip-ups whilst we're learning.

Now, copy the supplied jboss321all.server file into the servers directory.

cd plugins/
[vishal@localhost plugins]$ ls
com.objectlearn.jdt.j2ee
[vishal@localhost com.objectlearn.jdt.j2ee]$ cd servers
[vishal@localhost servers$ ls
jboss244.server.bak jboss303Tomcat4112.server.bak jboss300all.server.bak jboss321all.server
tomcat403.server.bak weblogic70.server
jboss300.server.bak tomcat410.server x.log


Here's a snippet from the file 'jboss321all.server' used for configuration. For this tutorial we will use this file, which you can download under Downloads.



Downloads :

jboss321all.server



You can change the various settings in this file according to your environment (e.g. the port number).

Once you have saved this file under the com.objectlearn.jdt.j2ee/servers directory, move the com.objectlearn.jdt.j2ee directory under $HOME/eclipse/plugins/ directory, where $HOME is your home directory.

[vishal@localhost temp/plugins] mv com.objectlearn.jdt.j2ee /home/vishal/eclipse/plugins/.

Now, we will configure Lomboz using this jboss321all.server file.

Note : Now you can now delete the temporary directory.



Lomboz Configuration.

Now run your Eclipse IDE to configure Lomboz ($HOME/eclipse/eclipse ).

Go to Window on top level menu > Open Perspective > Java as shown in fig below.

As we want to customize Java perspective for this tutorial:




Go to Window again at top level menu > Customize Perspective > Other.




Select Lomboz Actions sub node.




Click OK. Now you will have an icon under your top level menu like this.






Click on this icon will have a Lomboz J2EE View window in your workbench.




Now, Lomboz J2EE view is available.

Go to Window > Customize Perspective.

Select File > New sub node. Select all nodes starting with Lomboz.




Select Window > Show view. Select Console, Lomboz J2EE View and others as shown below in figure.




Now click ok. You will have all those options available from File > New > and Lomboz menu will appear, or by right clicking in the Package Explorer a pop up menu will appear.




Configure JBOSS to run from within Eclipse.

First of all we have to configure the Java Development settings, because Lomboz requires different directories for source and binaries.

Go to Window > Preferences > Java > New Project.

Enter src and bin for the names of these folders, which are the defaults. Please do not modify these names as they are required by some of the Lomboz tasks.

Also, make sure JRE library is set to 'JRE_LIB' variable.




Go to Window on top level menu > Preferences.




Go to the Lomboz node under the Preferences window. Make sure JDK Tools.jar is set to $JAVA_HOME/lib/tools.jar




Go to the server definitions sub node under Lomboz node. Select JBOSS 3.2.ALL under Server types and the rest of the options will be filled after loading the server configuration file which we made for this tutorial.




Now, under Server Definitions, go to 'Classpath' and make sure all the paths are correct. If there is a wrong setting for a path, it will show red crosses with jar icons in Server libraries / Client libraries sub section.




You can add or remove libraries from here. Make sure you 'Apply' the changes after altering the various options.

And now verify your 'Classpath Variables'.

Go to Window > Preferences > Java > Classpath Variables




If you get all these Classpath variables right according to your environment.



Test your configuration.

To test your configuration, create a J2EE Project as a test.

Go to File at top level menu > New > Lomboz J2EE Project.




Enter 'Test' as project name and press Next.

Check your settings here; if you have 'Test/src' on build path and 'Test/bin' under default output folders then it's ok.




Now click on Libraries tab on the Project Creation Wizard.

Because of a bug in Eclipse 2.1 this library is configured wrongly.

So select this library and Remove it.




Now, add a new library > Add Library.. > Select JRE System library > Next .






Select Default library and press Finish.




New library is configured.

Note: You have to repeat this step whenever you are creating a new J2EE Project, as there is a bug in eclipse 2.1.

Now press Next.

Go to Web Module > Add.. > Enter Module Name 'OnlineBank' > Ok.






Go to Ejb Modules tab > Add.. > Enter Module Name 'MyBank' > Ok.






Go to Targeted Server > Add.. > 'JBOSS 3.2.1 ALL' .

Note: 'JBOSS 3.2.1 ALL' is not the file name, but the name assigned to server in the 'jboss321all.server' file used for configuration showed above. Snippet from file below.

<serverDefinition
name="JBOSS 3.2.1 ALL"
ejbModules="true"






Press Finish.

Now you will have all these directories and libraries under Test Project in the Package Explorer.

Under Project Test 'src' is the directory where all packages for EJB components and Servlets will be developed, that is your java source files.

The 'MyBank' directory is your EJB Module and will have 7 files at start shown in fig below.

The 'OnlineBank' directory is your Web Module and will have 7 files shown in fig below. Your JSP pages will come under this directory for this module.

Note: If you are interested in Ant (from the Jakarta Project) then note that both modules have an Ant 'build.xml' file which is used to build the application.





Now go to top level menu option Window > Show View > Lomboz J2EE View.

Lomboz J2EE view will have Test Project , which has two modules 'MyBank' and 'OnlineBank' using JBOSS 3.2.1 as their default server.




Now it's time to create an EJB,

Go to File > New > Lomboz EJB creation wizard.

Note: You can access this wizard by right clicking in on project Test in Package Explorer. Go to New > Lomboz EJB creation wizard as explained in the beginning.

Add package name 'au.com.tusc'; you can choose another name if you want. Add 'MySession' in Name. Select Stateless Session EJB option.






This will create a file 'MySessionBean.java' under the 'au.com.tusc' package as shown in figure below.

Note: It will generate the bean name, jndi-name and type of bean in the file. Also the name of the file is appended with word 'Bean' as you gave the name of the bean as 'MySession' only. So be careful with naming conventions, as you only need to specify the bean name in the wizard. Don't append the word Bean to the name as the wizard will do that for you.






Now we will add a business method via the wizard.

Go to file 'MySessionBean.java' under 'Package Explorer' and expand that, right click on 'MySessionBean' node as shown in the figure below, select New > Lomboz EJB Method wizard.

In the method signature put 'public String learnJ2EE(String messg)', select method type as 'Business Method' and

Interface Type as 'Remote Interface'.




This will generate the required signature for your business method in your bean class.

Now add this line in this method "Me too! ";

Code Snippet from Bean file

 /**
  * @ejb.interface-method
  * tview-type="remote"
  *
  **/
     public  String learnJ2EE  (String messg)  { 
         return "Me too! ";
     }

Save the file.  Now we will generate the rest of the files (Home and Remote interfaces along with helper classes, using Xdoclet) required to deploy this bean.

First add this Bean to the module.

Go to Package Explorer > Test > MySessionBean.java > MySessionBean, right click on that; a menu will pop up. Go to Lomboz J2EE on this pop-up menu, and select 'Add EJB to module'.






Go to Package Explorer > Test > MyBank (which is a directory), right click on that; a menu will pop up.  Go to Lomboz J2EE, which is at the bottom of this pop up menu. Select Generate EJB classes. This will generate the required interfaces, helper classes and files related to deployment; that is, deployment descriptors.






It will create a new directory named ejbsrc, which will have a package named au.com.tusc, and under that, remote and home interfaces, along with necessary helper classes, will be generated.

Note: You will not edit any files generated by Xdoclet under 'ejbsrc' directory at any time while doing this tutorial. Because every time you use option Generate EJB Classes, it generates the necessary interfaces and helper classes as mentioned above. These files are generated by Xdoclet, after parsing your bean class, which is created by Lomboz bean creation wizard. Xdoclet looks at the various declared tags and methods in the bean class and then generates files accordingly. As a result, you just add business methods and their implementations in the bean class, and the rest is left to Xdoclet. Hence at any time in the development, you won't need to (and shouldn't!) edit any generated files. It will become clearer as we progress in this tutorial.

Also under MyBank > META-INF directory now there are 15 files, which includes ejb-jar.xml and jboss.xml and ejb-generate.xml. Initially there were only 6 files as noted earlier. These extra files are needed for deployment of the bean.




Now let us deploy this bean without going into any further details of deployment.

Go to Lomboz J2EE view in your workspace, expand Test > expand MyBank.

You will have au.com.tusc.MySessionBean added to your MyBank EJB module.

Right click on JBOSS 3.2.1 ALL icon as shown in fig below.






A menu will pop up; select option Debug Server.  It will start the server with Debug mode and after successful start it will show this message in the console under your workspace as shown in the figure below.




Go to Lombo J2EE View > expand Test > select MyBank and right click on that; a menu will pop up; select option Deploy.




Once the bean is deployed, a message will come in your 'Console' confirming that, as shown in the figure below.




Now we will create a client to access this bean deployed on JBOSS (application sever).

Go to Package Explorer > Test > src, right click on that, a menu will pop up > select EJB Test client.

Enter Package name 'test' and Client name as 'Client'.




Select EjbHome as 'MySessionHome' and Ejb Interface as 'MySession' > Finish as shown in the figure below.




Now the client is generated, it's time to call business methods on the deployed bean.

We need some code to invoke the method on the bean..




Go to Client.java and write these lines under the 'testBean()' method.

String request = "I'm tired of 'Hello, world' examples..";

System.out.println("Request from client : " + request);

System.out.println("Message from server : " + myBean.learnJ2EE(request) );

Code Snippet from Client.java.

     public void testBean() {
         try {
               au.com.tusc.MySession myBean = getHome().create();
               //--------------------------------------
                //This is the place you make your calls.
                //System.out.println(myBean.callYourMethod());
               String request = "I'm tired of 'Hello, world' examples..";
               System.out.println("Request from client : " + request);
               System.out.println("Message from server : " + myBean.learnJ2EE(request) );

          } catch (RemoteException e) {
                 e.printStackTrace();
          } catch (CreateException e) {
                 e.printStackTrace();
          } catch (NamingException e) {
                 e.printStackTrace();
          }
     }


Now first select Client node under Package Explorer. Go to top level menu and select this icon as shown below.


On this icon go to > Run as > Java Application.




Your Client is going to make a request, the results of which will be displayed in the console under your workspace, as shown below.




Note: Ignore these exceptions regarding org.apache.log4j.Property as it requires 'log4j.properties' on the clients path. We will cover this later on as this doesn't affect the functioning of the bean.


You have successfully created a bean and invoked an operation on it. Now, let's have a brief overview of J2EE concepts in the next chapter, before we start implementing the case study.


AI辅助游戏开发实战:Kimi K3提升Unity开发效率与代码质量 在游戏开发领域,有限状态机(FSM)是构建角色AI行为逻辑的核心设计模式,它通过定义明确的状态和转换条件,使游戏实体能够智能地响应环境变化。其原理在于将复杂的行为分解为离散的状态节点,并通过事件驱动状态切换,从而实现清晰、可维护的AI架构。这项技术的价值在于显著提升了游戏角色的行为真实感和开发效率,被广泛应用于NPC行为控制、角色动画管理、UI流程等场景。随着AI编程助手的兴起,开发者现在可以借助如Kimi K3这类工具,通过自然语言指令快速生成和优化FSM等复杂系统的代码框架,将更多精力投入到核心玩法与性 阅读详情

相关推荐

倍福ADS通讯协议深度解析——从握手到数据包的完整旅程

本文以工程师视角,通过Wireshark抓包实战,深度解析了倍福ADS通讯协议的完整工作流程。从TCP三次握手建立连接,到拆解AMS/TCP信封、AMS Header地址与命令解析,再到ADS Data读写请求的载荷构成,完整呈现了一次数据通讯的“旅程”。文章重点剖析了协议包格式,并结合实际案例,提供了基于协议分析的故障排查思路,帮助开发者深入理解并精准调试工业自动化系统通讯。

weixin_29231725的博客 161

Tutorial for building J2EE Applications using JBOSS and ECLIPSE -1

Chapter 1Configuration of ECLIPSE to use JBOSS and LOMBOZInstall Eclipse. First of all we have to set up Eclipse Integrated Development Environment (IDE) with JBOSS as our application server.

阿龙专栏 1951

学习笔记|多组率卡方检验和Fisher确切法|个案加权|规范表达|《小白爱上SPSS》课程:SPSS第十六讲 | 多组率卡方检验和Fisher确切法

学习笔记|多组率卡方检验和Fisher确切法|个案加权|规范表达|《小白爱上SPSS》课程:SPSS第十六讲 | 多组率卡方检验和Fisher确切法

Medlar_CN的博客 2970

Tutorial for building J2EE Applications using JBOSS and ECLIPSE Chapter 1

现在才补回chapter的阅读经历是因为觉得有一个地方的确要提一下。 在安装配置的时候,资料上说明是使用jboss-3.2.1和lomboz.21_02,我决定使用jboss 3.2.5和lomboz 213。虽然对jboss新增的版本特性不清楚,但是我想既然能升级,已经是解决了已经遗留的问题。但是我在配置的时候却给我增添了麻烦。lobmboz 213并没有对jboss 3.2.5有相应的配置文件

中国 IT 应用/ Adapting information technology in china 1266

保姆级教程:用PyBullet和Stable-Baselines3搞定你的第一个机器人强化学习项目

本文提供了一份详细的PyBullet和Stable-Baselines3教程,帮助开发者快速上手机器人强化学习项目。通过环境配置、自定义Gym环境构建、PPO算法参数优化及模型部署的全流程解析,读者将掌握从零开始训练四足机器人 locomotion 任务的完整技术方案。

weixin_26861329的博客 427

iOS WKWebView H5微信支付跳转

iOS WKWebView H5微信支付跳转 需求:iOS客户端实现嵌入H5进行微信支付跳转到微信客户端,支付完成后再跳转回我们的APP,解决WKWebView无法跳转回APP的BUG. 阅读前提: 了解WKWebView基本初始化及使用 了解如何利用URL Schemes进行应用间跳转 公司或个人已经在微信后台注册了一级域名 GitHub地址(附代码) :iOS WKWebView H5微信支付跳转 简书地址 :iOS WKWebView H5微信支付跳转 博客地址 :iOS WKWe...

ForeverMyheart的博客 2052

Tutorial for building J2EE Applications using JBOSS and ECLIPSE Chapter 2 part 1

All J2EE components are written in the Java programming language 这句话开宗明义的说明了J2EE只能用java来开发,我听说有一些开源爱好者已经可以做到用.net来做,然后通过一些转换器来工作,我也不是很了解这个东西。不过就我而言,要开发.net的就用微软的东西,不要想太多,毕竟那个才是专业的。开发j2ee还是用java算了。 T

中国 IT 应用/ Adapting information technology in china 1403

课设:FPGA音频均衡器 verilog设计及仿真 加报告

未来,随着FPGA技术的进一步发展和应用场景的扩大,FPGA音频均衡器将发挥出更大的作用,并为音频领域带来更多创新和突破。(a)音乐制作:均衡器可以调整音频信号中不同频段的能量分布,使得乐器声音更加明亮、动感,从而提升音乐制作的质量和创作的灵活性。以上步骤提供了设计一个音频均衡器的大致过程,但值得注意的是,具体实现的细节和复杂度可能因设计要求和所使用的平台而有所不同。确保设计满足预期的性能和要求。确定均衡器的功能和要求:定义你的音频均衡器需要实现的功能,包括频率范围、增益范围以及可调参数数量等。

QQ_778132974的博客 1592

Tutorial for building J2EE Applications using JBOSS and ECLIPSE -2

Chapter 2. Overview Of J2EE Technology and ConceptsThe Java 2 Enterprise Edition (J2EE) is a multitiered architecture for implementing enterprise-class applications and web based applications. T

阿龙专栏 2238

RT-DETR训练自己的数据集(从代码下载到实例测试)

在Windows10上配置CUDA环境教程是百度提出的一种实时目标检测模型。RT-DETR采用了与DETR相同的编码器和解码器结构,但对其进行了大量的优化,在保持较高检测精度的同时,实现了实时目标检测,为目标检测领域提供了一种新的有效解决方案,具有广泛的应用前景,如自动驾驶、智能监控、机器人等领域。以上是RT-DETR官方的论文和代码,详细介绍了RT-DETR的构成和实现。在YOLOv10中也实现了RT-DETR的代码,所以本文使用YOLOv10的项目文件进行RT-DETR的训练和测试。YOLOv10。

Limiiiing的博客 4万+

高可用架构设计——多节点OpenClaw集群部署与负载均衡(2026企业级)

本文介绍了企业级OpenClaw高可用集群架构设计,重点阐述了多节点部署与负载均衡方案。架构采用分层设计,包括表现层、应用层、数据层和基础设施层,确保99.99%的可用性目标。详细配置了主节点、工作节点和存储节点规格,提供Kubernetes集群部署脚本示例,实现自动化的容器编排管理。通过硬件冗余、故障隔离和弹性扩展等可靠性原则,构建能够应对各种故障场景的稳定AI助手系统。

博客 428

Tutorial for building J2EE Applications using JBOSS and ECLIPSE Chapter 3

在阅读这一章的时候,基本没有什么障碍,但是有一个地方文章是写错了。 在Create DAO Interface  那一节中“Go to src > add package named au.com.tusc.dao > Add a class StoreAcessDAOImpl in that package”红色字体错了,应该是StoreAccessDAOImpl。 还有就是因为使用不同版本的j

中国 IT 应用/ Adapting information technology in china 1206

MounRiver Studio(MRS)使用技巧:添加头文件目录;增加代码分组

MounRiver Studio(MRS)使用技巧:添加头文件目录

cheng___yi的博客 1817

Tutorial for building J2EE Applications using JBOSS and ECLIPSE -5

Chapter 5. Creating a BMP Entity BeanThis chapter describes how to create a Bean Managed Persistence (BMP) EJB component. We will create two BMP beans, Customer and Manager, as shown below. The

阿龙专栏 1733

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

Tutorial for building J2EE Applications using JBOSS and ECLIPSE

Table of ContentsTutorial.PrefaceAbout the AuthorsAcknowledgmentsDisclaimerIntroductionPrerequisites for this tutorialTools re

阿龙专栏 4632

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

Tutorial for building J2EE Applications using JBOSS and ECLIPSE -7

Chapter 7. Creating a Message Driven BeanThis chapter covers how to create a Message Driven Bean (MDB) EJB component. We will create two MDB beans, DeliverItems and RequestItems as shown below.

阿龙专栏 1499

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Tutorial for building J2EE Applications using JBOSS and ECLIPSE Chapter 2 part 2

J2EE中的分布式应用(Distributed Architecture in J2EE ) 刚好在huihoo论坛看了一篇文章说到如何提高jboss的RMI/IIOP的效率问题,“有个应用是客户端swing+j2ee SERVER ,跑在内网没问题的。现在有个客户,很多分支机构,都是通过adsl(2m带宽)连到总部。j2ee服务器放在总部,感觉特别慢”,这个问题我现在还找不到解决的方法。刚好又看

中国 IT 应用/ Adapting information technology in china 1931

Tutorial for building J2EE Applications using JBOSS and ECLIPSE(3)

Chapter 3. Creating a Stateless Session BeanThis chapter covers how to create a stateless session EJB component. This bean will be responsible for authenticating the user by communicating with the dat

Zero'Coffee 1136

Tutorial for building J2EE Applications using JBOSS and ECLIPSE -3

Chapter 3. Creating a Stateless Session BeanThis chapter covers how to create a stateless session EJB component. This bean will be responsible for authenticating the user by communicating with t

阿龙专栏 1621

Tutorial for building J2EE Applications using JBOSS and ECLIPSE(4)

Chapter 4. Creating a Stateful Session BeanThis chapter covers how to create a stateful session EJB component. Unlike stateless beans, stateful bean instances are associated with a particular client s

Zero'Coffee 1143

Tutorial for building J2EE Applications using JBOSS and ECLIPSE(2)

Chapter 2. Overview Of J2EE Technology and ConceptsThe Java 2 Enterprise Edition (J2EE) is a multitiered architecture for implementing enterprise-class applications and web based applications. This te

Zero'Coffee 1120

Tutorial for building J2EE Applications using JBOSS and ECLIPSE -4

Chapter 4. Creating a Stateful Session BeanThis chapter covers how to create a stateful session EJB component. Unlike stateless beans, stateful bean instances are associated with a particular cl

阿龙专栏 1440

Tutorial for building J2EE Applications using JBOSS and ECLIPSE-6

Chapter 6. Creating a CMP Entity BeanThis chapter covers how to create a Container Managed Persistence (CMP) EJB component. We will create two CMP beans, Item and Supplier as shown below. The It

阿龙专栏 1573
上一篇: 用JAVA实现一个分页类
下一篇: Tutorial for building J2EE Applications using JBOSS and ECLIPSE(2)
narilee
博客等级 码龄23年 0粉丝 74原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值