How to use Sencha SDK for ExtJS?

I am using ExtJS 4.1 and I am deploying my simple HelloExt program on GlassFish V3.1.

I am trying to create an assembly from the Sencha SDK.

I used the following two commands ...

C:\>sencha create jsb -a http://localhost:8080/HelloExt/index.jsp -p appname.jsb 3 -v C:\>sencha build -p appname.jsb3 -v -d . 

According to the documentation, he will create the app-all.js file. But where does he create the file?

How can I find out if the IF assembly was created successfully or not?

Where are the generated js files?

I did a search but did not find anything like app-all.js.

For more information:

I am using JDK 1.6.0_12 and GlassFish V3.1 application server.

Here is the edited question content ....

And when I try to use the sencha SDK, it generates a .dpf file in the class path. The contents of the .dpf file as shown below ...

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> <glassfish-web-app error-url=""> <context-root>/HelloExt</context-root> <class-loader delegate="true"/> <jsp-config> <property name="keepgenerated" value="true"> <description>Keep a copy of the generated servlet class' java code.</description> </property> </jsp-config> </glassfish-web-app> 

Can someone tell me why he generated the .DPF file here? Why doesn't it generate the app-all.js file?

+7
source share
1 answer

Try running the command from the root directory of the application, and then using the relative path:

0) open cmd window

1) run in the cmd: "cd C: \ [webserver_webapp_root] \ [application_name]" window

In other words, change the cmd directory to the root of the application. Fill in the text in brackets above with the correct paths.

2) run in the cmd window: "sencha create jsb -a index.html -p app.jsb3 -v"

app.jsb3 must be created in the root directory of the application (C: \ [webserver_webapp_root] \ [username]). Open it and make sure that it contains all your application classes, it should look something like this:

 { "projectName": "Project Name", "licenseText": "Copyright(c) 2012 Company Name", "builds": [ { "name": "All Classes", "target": "all-classes.js", "options": { "debug": true }, "files": [ { "clsName": "YourApp.view.Viewport", "name": "Viewport.js", "path": "app/view/" }, // plus ALOT more classes... ] }, { "name": "Application - Production", "target": "app-all.js", "compress": true, "files": [ { "path": "", "name": "all-classes.js" }, { "path": "", "name": "app.js" } ] } ], "resources": [] } 

If everything looks fine, you can go to the next step, if not, then something is wrong with your application directory structure, and you need to fix it for Sencha recommended ExtJS application architecture .

You can also use any error messages to help identify the problem.

3) update placeholders ("Project Name", etc.) at the top of app.jsb3

4) run in the cmd window: "sencha build -p app.jsb3 -d. -V"

The app-all.js must also be created in the root directory of the application. If the cmd window does not give any errors, before it says "Done Building!" then you are all done. Now you can change the index.html script link to point to app-all.js instead of app.js

If there are errors, you should correct them and start again.

Other things you can try:

In response to your last comment, your -p parameter should be jsb3 not jsb .

Make sure the web server is up and running without any errors before trying to use the SDK tools.

Then try the following:

 C:\Projects\HelloExt\build\web>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v C:\Projects\HelloExt>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v C:\>sencha create jsb -a [actual IP address]:8080/HelloExt/index.jsp -p HelloExt.jsb3 -v 

Fill in your actual IP address where the brackets are (not localhost ).

This should result in the jsb3 file shown in # 2 above, you can go to step # 3 above.

+6
source

All Articles